
//-------------------------------------------------------------------------
//   Copyright 2002-2023 National Technology & Engineering Solutions of
//   Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
//   NTESS, the U.S. Government retains certain rights in this software.
//
//   This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
//   Xyce(TM) is free software: you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   Xyce(TM) is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with Xyce(TM).
//   If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
//
// Purpose        :
//
// Special Notes  : Generated from verilog file hicumL0V1p32.va with ADMS
//                  interface for Xyce 7.7.0
//                  DO NOT EDIT THIS FILE DIRECTLY!  It may be overwritten!
//
// Creator        : admsXml-2.3.7
//
// Creation Date  : Mon, 09 Jan 2023 12:53:25
//
//-------------------------------------------------------------------------
// Shut up clang's warnings about extraneous parentheses
#ifdef __clang__
#  pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#include <Xyce_config.h>
#include <N_DEV_ADMShic0_full.h>


#include <N_DEV_Const.h>
#include <N_DEV_DeviceOptions.h>
#include <N_DEV_DeviceMaster.h>
#include <N_DEV_ExternData.h>
#include <N_DEV_SolverState.h>
#include <N_DEV_Message.h>

#include <N_LAS_Matrix.h>
#include <N_LAS_Vector.h>

  #include <N_ANP_NoiseData.h>

#include <N_UTL_FeatureTest.h>
#include <unordered_map>
using std::unordered_map;

#include <algorithm>

// Xyce_config.h contains a VERSION macro from autoconf, and some
// Verilog-A models like to define a variable of that name.  This can be
// a serious problem, and we don't need the VERSION macro.  Get rid of it.
// This must happen *after* all includes of Xyce headers, each of which
// includes Xyce_config.h!
#ifdef VERSION
#undef VERSION
#endif

namespace Xyce {
namespace Device {
namespace ADMShic0_full {


//This is necessary because the IntPair usage can trip undefined references
    const int Instance::admsNodeID_c;
    const int Instance::admsNodeID_b;
    const int Instance::admsNodeID_e;
    const int Instance::admsNodeID_s;
    const int Instance::admsNodeID_tnode;
    const int Instance::admsNodeID_ci;
    const int Instance::admsNodeID_bi;
    const int Instance::admsNodeID_ei;
    const int Instance::admsNodeID_xf1;
    const int Instance::admsNodeID_xf2;
    const int Instance::admsNodeID_xf;
     const int Instance::admsNodeID_GND;
   // Additional IDs for branch equations


void
Traits::loadInstanceParameters(ParametricData<ADMShic0_full::Instance> &p)
{
  // Set up each parameter directly, using the up-cased variable name
  // as the tag.

  // This kludge is to force us always to have an instance parameter
  // that the device manager can set to the temperature, even if we have
  // no "TEMP".
  p.addPar("XYCEADMSINSTTEMP", 0.0, &ADMShic0_full::Instance::admsInstTemp)
    .setExpressionAccess(NO_DOC)
    .setUnit(U_DEGK)
    .setCategory(CAT_TEMP)
    .setDescription("Internal-use parameter for setting device instance temperature");
  p.addPar("DT", static_cast<double>(0.0), &ADMShic0_full::Instance::dt)
    .setDescription("Temperature change for particular transistor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&instSens)
#endif // Xyce_ADMS_SENSITIVITIES
;


}

void Traits::loadModelParameters(ParametricData<ADMShic0_full::Model> &p)
{
  // Set up each parameter directly, using the up-cased variable name
  // as the tag.

  // This kludge is to force us always to have a model parameter
  // that the device manager can set to the temperature, even if we have
  // no "TEMP".
  p.addPar("XYCEADMSMODTEMP", 0.0, &ADMShic0_full::Model::admsModTemp)
    .setExpressionAccess(NO_DOC)
    .setUnit(U_DEGK)
    .setCategory(CAT_TEMP)
    .setDescription("Internal-use parameter for setting device model temperature");
  p.addPar("IS", static_cast<double>(1.0e-16), &ADMShic0_full::Model::is)
    .setDescription("(Modified) saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IT_MOD", static_cast<int>(0), &ADMShic0_full::Model::it_mod)
    .setDescription("Flag for using third order solution for transfer current");
  p.addPar("MCF", static_cast<double>(1.00), &ADMShic0_full::Model::mcf)
    .setDescription("Non-ideality coefficient of forward collector current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MCR", static_cast<double>(1.00), &ADMShic0_full::Model::mcr)
    .setDescription("Non-ideality coefficient of reverse collector current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VEF", static_cast<double>(1.0e6), &ADMShic0_full::Model::vef)
    .setDescription("forward Early voltage (normalization volt.)")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VER", static_cast<double>(1.0e6), &ADMShic0_full::Model::ver)
    .setDescription("reverse Early voltage (normalization volt.)")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AVER", static_cast<double>(0.0), &ADMShic0_full::Model::aver)
    .setDescription("bias dependence for reverse Early voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IQF", static_cast<double>(1.0e6), &ADMShic0_full::Model::iqf)
    .setDescription("forward d.c. high-injection toll-off current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("FIQF", static_cast<double>(0), &ADMShic0_full::Model::fiqf)
    .setDescription("flag for turning on base related critical current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IQR", static_cast<double>(1.0e6), &ADMShic0_full::Model::iqr)
    .setDescription("inverse d.c. high-injection roll-off current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IQFH", static_cast<double>(1.0e6), &ADMShic0_full::Model::iqfh)
    .setDescription("high-injection correction current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TFH", static_cast<double>(0.0), &ADMShic0_full::Model::tfh)
    .setDescription("high-injection correction factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AHQ", static_cast<double>(0), &ADMShic0_full::Model::ahq)
    .setDescription("Smoothing factor for the d.c. injection width")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IBES", static_cast<double>(1e-18), &ADMShic0_full::Model::ibes)
    .setDescription("BE saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MBE", static_cast<double>(1.0), &ADMShic0_full::Model::mbe)
    .setDescription("BE non-ideality factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IRES", static_cast<double>(0.0), &ADMShic0_full::Model::ires)
    .setDescription("BE recombination saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MRE", static_cast<double>(2.0), &ADMShic0_full::Model::mre)
    .setDescription("BE recombination non-ideality factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("IBCS", static_cast<double>(0.0), &ADMShic0_full::Model::ibcs)
    .setDescription("BC saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MBC", static_cast<double>(1.0), &ADMShic0_full::Model::mbc)
    .setDescription("BC non-ideality factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CJE0", static_cast<double>(1.0e-20), &ADMShic0_full::Model::cje0)
    .setDescription("Zero-bias BE depletion capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VDE", static_cast<double>(0.9), &ADMShic0_full::Model::vde)
    .setDescription("BE built-in voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZE", static_cast<double>(0.5), &ADMShic0_full::Model::ze)
    .setDescription("BE exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AJE", static_cast<double>(2.5), &ADMShic0_full::Model::aje)
    .setDescription("Ratio of maximum to zero-bias value")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VDEDC", static_cast<double>(0.9), &ADMShic0_full::Model::vdedc)
    .setDescription("BE charge built-in voltage for d.c. transfer current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZEDC", static_cast<double>(0.5), &ADMShic0_full::Model::zedc)
    .setDescription("charge BE exponent factor for d.c. transfer current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AJEDC", static_cast<double>(2.5), &ADMShic0_full::Model::ajedc)
    .setDescription("BE capacitance ratio Ratio maximum to zero-bias value for d.c. transfer current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("T0", static_cast<double>(0.0), &ADMShic0_full::Model::t0)
    .setDescription("low current transit time at Vbici=0")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("DT0H", static_cast<double>(0.0), &ADMShic0_full::Model::dt0h)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TBVL", static_cast<double>(0.0), &ADMShic0_full::Model::tbvl)
    .setDescription("SCR width modulation contribution")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TEF0", static_cast<double>(0.0), &ADMShic0_full::Model::tef0)
    .setDescription("Storage time in neutral emitter")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("GTE", static_cast<double>(1.0), &ADMShic0_full::Model::gte)
    .setDescription("Exponent factor for emmiter transit time")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("THCS", static_cast<double>(0.0), &ADMShic0_full::Model::thcs)
    .setDescription("Saturation time at high current densities")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AHC", static_cast<double>(0.1), &ADMShic0_full::Model::ahc)
    .setDescription("Smoothing facor for current dependence")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TR", static_cast<double>(0.0), &ADMShic0_full::Model::tr)
    .setDescription("Storage time at inverse operation")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("RCI0", static_cast<double>(150), &ADMShic0_full::Model::rci0)
    .setDescription("Low-field collector resistance under emitter")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VLIM", static_cast<double>(0.5), &ADMShic0_full::Model::vlim)
    .setDescription("Voltage dividing ohmic and satur.region")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VPT", static_cast<double>(100), &ADMShic0_full::Model::vpt)
    .setDescription("Punch-through voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VCES", static_cast<double>(0.1), &ADMShic0_full::Model::vces)
    .setDescription("Saturation voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CJCI0", static_cast<double>(1.0e-20), &ADMShic0_full::Model::cjci0)
    .setDescription("Total zero-bias BC depletion capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VDCI", static_cast<double>(0.7), &ADMShic0_full::Model::vdci)
    .setDescription("BC built-in voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZCI", static_cast<double>(0.333), &ADMShic0_full::Model::zci)
    .setDescription("BC exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VPTCI", static_cast<double>(100), &ADMShic0_full::Model::vptci)
    .setDescription("Punch-through voltage of BC junction")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CJCX0", static_cast<double>(1.0e-20), &ADMShic0_full::Model::cjcx0)
    .setDescription("Zero-bias external BC depletion capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VDCX", static_cast<double>(0.7), &ADMShic0_full::Model::vdcx)
    .setDescription("External BC built-in voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZCX", static_cast<double>(0.333), &ADMShic0_full::Model::zcx)
    .setDescription("External BC exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VPTCX", static_cast<double>(100), &ADMShic0_full::Model::vptcx)
    .setDescription("Punch-through voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("FBC", static_cast<double>(1.0), &ADMShic0_full::Model::fbc)
    .setDescription("Split factor = Cjci0/Cjc0")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("RBI0", static_cast<double>(0.0), &ADMShic0_full::Model::rbi0)
    .setDescription("Internal base resistance at zero-bias")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VR0E", static_cast<double>(2.5), &ADMShic0_full::Model::vr0e)
    .setDescription("forward Early voltage (normalization volt.)")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VR0C", static_cast<double>(1.0e6), &ADMShic0_full::Model::vr0c)
    .setDescription("forward Early voltage (normalization volt.)")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("FGEO", static_cast<double>(0.656), &ADMShic0_full::Model::fgeo)
    .setDescription("Geometry factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("RBX", static_cast<double>(0.0), &ADMShic0_full::Model::rbx)
    .setDescription("External base series resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("RCX", static_cast<double>(0.0), &ADMShic0_full::Model::rcx)
    .setDescription("Emitter series resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("RE", static_cast<double>(0.0), &ADMShic0_full::Model::re)
    .setDescription("External collector series resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ITSS", static_cast<double>(0.0), &ADMShic0_full::Model::itss)
    .setDescription("Substrate transistor transfer saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MSF", static_cast<double>(1.0), &ADMShic0_full::Model::msf)
    .setDescription("Substrate transistor transfer current non-ideality factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ISCS", static_cast<double>(0.0), &ADMShic0_full::Model::iscs)
    .setDescription("SC saturation current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("MSC", static_cast<double>(1.0), &ADMShic0_full::Model::msc)
    .setDescription("SC non-ideality factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CJS0", static_cast<double>(1.0e-20), &ADMShic0_full::Model::cjs0)
    .setDescription("Zero-bias SC depletion capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VDS", static_cast<double>(0.3), &ADMShic0_full::Model::vds)
    .setDescription("SC built-in voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZS", static_cast<double>(0.3), &ADMShic0_full::Model::zs)
    .setDescription("External SC exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VPTS", static_cast<double>(100), &ADMShic0_full::Model::vpts)
    .setDescription("SC punch-through voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CBCPAR", static_cast<double>(0.0), &ADMShic0_full::Model::cbcpar)
    .setDescription("Collector-base isolation (overlap) capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CBEPAR", static_cast<double>(0.0), &ADMShic0_full::Model::cbepar)
    .setDescription("Emitter-base oxide capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("EAVL", static_cast<double>(0.0), &ADMShic0_full::Model::eavl)
    .setDescription("Exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("KAVL", static_cast<double>(0.0), &ADMShic0_full::Model::kavl)
    .setDescription("Prefactor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("KF", static_cast<double>(0.0), &ADMShic0_full::Model::kf)
    .setDescription("flicker noise coefficient")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("AF", static_cast<double>(2.0), &ADMShic0_full::Model::af)
    .setDescription("flicker noise exponent factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALQF", static_cast<double>(0.167), &ADMShic0_full::Model::alqf)
    .setDescription("Factor for additional delay time of minority charge")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALIT", static_cast<double>(0.333), &ADMShic0_full::Model::alit)
    .setDescription("Factor for additional delay time of transfer current")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("FLNQS", static_cast<int>(0), &ADMShic0_full::Model::flnqs)
    .setDescription("Flag for turning on and off of vertical NQS effect");
  p.addPar("VGB", static_cast<double>(1.2), &ADMShic0_full::Model::vgb)
    .setDescription("Bandgap-voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VGE", static_cast<double>(1.17), &ADMShic0_full::Model::vge)
    .setDescription("Effective emitter bandgap-voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VGC", static_cast<double>(1.17), &ADMShic0_full::Model::vgc)
    .setDescription("Effective collector bandgap-voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("VGS", static_cast<double>(1.17), &ADMShic0_full::Model::vgs)
    .setDescription("Effective substrate bandgap-voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("F1VG", static_cast<double>((-1.02377e-4)), &ADMShic0_full::Model::f1vg)
    .setDescription("Coefficient K1 in T-dependent bandgap equation")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("F2VG", static_cast<double>(4.3215e-4), &ADMShic0_full::Model::f2vg)
    .setDescription("Coefficient K2 in T-dependent bandgap equation")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALT0", static_cast<double>(0.0), &ADMShic0_full::Model::alt0)
    .setDescription("Frist-order TC of tf0")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("KT0", static_cast<double>(0.0), &ADMShic0_full::Model::kt0)
    .setDescription("Second-order TC of tf0")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETACT", static_cast<double>(3.0), &ADMShic0_full::Model::zetact)
    .setDescription("Exponent coefficient in transfer current temperature dependence")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETABET", static_cast<double>(3.5), &ADMShic0_full::Model::zetabet)
    .setDescription("Exponent coefficient in BE junction current temperature dependence")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETACI", static_cast<double>(0.0), &ADMShic0_full::Model::zetaci)
    .setDescription("TC of epi-collector diffusivity")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALVS", static_cast<double>(0.0), &ADMShic0_full::Model::alvs)
    .setDescription("Relative TC of satur.drift velocity")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALCES", static_cast<double>(0.0), &ADMShic0_full::Model::alces)
    .setDescription("Relative TC of vces")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETARBI", static_cast<double>(0.0), &ADMShic0_full::Model::zetarbi)
    .setDescription("TC of internal base resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETARBX", static_cast<double>(0.0), &ADMShic0_full::Model::zetarbx)
    .setDescription("TC of external base resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETARCX", static_cast<double>(0.0), &ADMShic0_full::Model::zetarcx)
    .setDescription("TC of external collector resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETARE", static_cast<double>(0.0), &ADMShic0_full::Model::zetare)
    .setDescription("TC of emitter resistances")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETAIQF", static_cast<double>(0.0), &ADMShic0_full::Model::zetaiqf)
    .setDescription("TC of iqf")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALKAV", static_cast<double>(0.0), &ADMShic0_full::Model::alkav)
    .setDescription("TC of avalanche prefactor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALEAV", static_cast<double>(0.0), &ADMShic0_full::Model::aleav)
    .setDescription("TC of avalanche exponential factor")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETARTH", static_cast<double>(0.0), &ADMShic0_full::Model::zetarth)
    .setDescription("Exponent factor for temperature dependent thermal resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TEF_TEMP", static_cast<int>(1), &ADMShic0_full::Model::tef_temp)
    .setDescription("Flag for turning temperature dependence of tef0 on and off");
  p.addPar("ZETAVER", static_cast<double>((-1.0)), &ADMShic0_full::Model::zetaver)
    .setDescription("TC of Reverse Early voltage")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ZETAVGBE", static_cast<double>(1.0), &ADMShic0_full::Model::zetavgbe)
    .setDescription("TC of AVER")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("DVGBE", static_cast<double>(0.0), &ADMShic0_full::Model::dvgbe)
    .setDescription("Bandgap difference between base and BE-junction")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("ALIQFH", static_cast<double>(0), &ADMShic0_full::Model::aliqfh)
    .setDescription("Frist-order TC of iqfh")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("KIQFH", static_cast<double>(0), &ADMShic0_full::Model::kiqfh)
    .setDescription("Second-order TC of iqfh")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("FLSH", static_cast<int>(0), &ADMShic0_full::Model::flsh)
    .setDescription("Flag for self-heating calculation");
  p.addPar("RTH", static_cast<double>(0.0), &ADMShic0_full::Model::rth)
    .setDescription("Thermal resistance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("CTH", static_cast<double>(0.0), &ADMShic0_full::Model::cth)
    .setDescription("Thermal capacitance")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;
  p.addPar("TYPE", static_cast<int>(1), &ADMShic0_full::Model::type)
    .setDescription("For transistor type NPN(+1) or PNP (-1)");
  p.addPar("TNOM", static_cast<double>(27), &ADMShic0_full::Model::tnom)
    .setDescription("Temperature for which parameters are valid")
   .setAutoConvertTemperature(false)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
;

}

//-----------------------------------------------------------------------------
// Function      : Instance::processParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::processParams()
{
  // set any non-constant parameter defaults

  // copy any model variables that have associated instance variables, but
  // are only given in the model card:



  // Set any parameters that were not given and whose defaults depend on other
  // parameters:


// Now we need to check that any parameters are within their ranges as
  // specified in the verilog:


  // this seems a little stupid, but verilog models that use $temperature
  // don't also use a defined parameter "Temp", and count on $temperature
  // to be the one the simulator wants:

  updateTemperature(admsInstTemp);

  // and of course, this routine is where we should put the initial_instance
  // stuff


  return true;
}

//-----------------------------------------------------------------------------
// Function      : Instance::Instance
// Purpose       : "instance block" constructor
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------

Instance::Instance(
  const Configuration & configuration,
  const InstanceBlock & instance_block,
  Model &               model,
  const FactoryBlock &  factory_block)
  : DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
    model_(model),
    dt(0.0),
    qjci(0.0),
d_qjci_dV_bi_ci(0.0),
d_qjci_dV_tnode_GND(0.0),
d_qjci_dV_b_ci(0.0),
    qjei(0.0),
d_qjei_dV_tnode_GND(0.0),
d_qjei_dV_ci_ei(0.0),
d_qjei_dV_bi_ei(0.0),
d_qjei_dV_bi_ci(0.0),
d_qjei_dV_b_ci(0.0),
    it(0.0),
d_it_dV_xf2_GND(0.0),
d_it_dV_tnode_GND(0.0),
d_it_dV_bi_ei(0.0),
d_it_dV_bi_ci(0.0),
d_it_dV_b_ci(0.0),
d_it_dV_ci_ei(0.0),
    ijbc(0.0),
d_ijbc_dV_tnode_GND(0.0),
d_ijbc_dV_bi_ci(0.0),
d_ijbc_dV_bi_ei(0.0),
    iavl(0.0),
d_iavl_dV_tnode_GND(0.0),
d_iavl_dV_bi_ei(0.0),
d_iavl_dV_bi_ci(0.0),
d_iavl_dV_b_ci(0.0),
d_iavl_dV_ci_ei(0.0),
    ijsc(0.0),
d_ijsc_dV_tnode_GND(0.0),
d_ijsc_dV_s_ci(0.0),
d_ijsc_dV_bi_ci(0.0),
d_ijsc_dV_bi_ei(0.0),
    Ibici(0.0),
d_Ibici_dV_tnode_GND(0.0),
d_Ibici_dV_bi_ci(0.0),
d_Ibici_dV_bi_ei(0.0),
d_Ibici_dV_b_ci(0.0),
d_Ibici_dV_ci_ei(0.0),
    ijbe(0.0),
d_ijbe_dV_tnode_GND(0.0),
d_ijbe_dV_bi_ei(0.0),
    IAVL(0.0),
    VBE(0.0),
    VBC(0.0),
    VCE(0.0),
    VSC(0.0),
    GMi(0.0),
    RPIi(0.0),
    RMUi(0.0),
    ROi(0.0),
    CPIi(0.0),
    CMUi(0.0),
    CBCX(0.0),
    CCS(0.0),
    RBi(0.0),
    RB(0.0),
    RCX(0.0),
    RE(0.0),
    BETAAC(0.0),
    TF(0.0),
    FT(0.0),
    li_c(-1),
    li_b(-1),
    li_e(-1),
    li_s(-1),
    li_tnode(-1),
    li_ci(-1),
    li_bi(-1),
    li_ei(-1),
    li_xf1(-1),
    li_xf2(-1),
    li_xf(-1),
    li_branch_ic(-1),
    li_branch_ib(-1),
    li_branch_ie(-1),
    li_branch_is(-1),
    li_branch_itnode(-1),
    f_bi_Equ_bi_Node_Ptr(0),
    f_bi_Equ_ei_Node_Ptr(0),
    f_ei_Equ_bi_Node_Ptr(0),
    f_ei_Equ_ei_Node_Ptr(0),
    f_bi_Equ_ci_Node_Ptr(0),
    f_ci_Equ_bi_Node_Ptr(0),
    f_ci_Equ_ci_Node_Ptr(0),
    f_ci_Equ_ei_Node_Ptr(0),
    f_ei_Equ_ci_Node_Ptr(0),
    f_b_Equ_s_Node_Ptr(0),
    f_b_Equ_ci_Node_Ptr(0),
    f_s_Equ_s_Node_Ptr(0),
    f_s_Equ_ci_Node_Ptr(0),
    f_b_Equ_b_Node_Ptr(0),
    f_s_Equ_b_Node_Ptr(0),
    f_b_Equ_tnode_Node_Ptr(0),
    f_s_Equ_tnode_Node_Ptr(0),
    f_s_Equ_bi_Node_Ptr(0),
    f_s_Equ_ei_Node_Ptr(0),
    f_ci_Equ_s_Node_Ptr(0),
    f_ci_Equ_tnode_Node_Ptr(0),
    f_ci_Equ_b_Node_Ptr(0),
    f_b_Equ_bi_Node_Ptr(0),
    f_b_Equ_e_Node_Ptr(0),
    f_e_Equ_b_Node_Ptr(0),
    f_e_Equ_e_Node_Ptr(0),
    f_ei_Equ_tnode_Node_Ptr(0),
    f_e_Equ_tnode_Node_Ptr(0),
    f_ei_Equ_e_Node_Ptr(0),
    f_e_Equ_ei_Node_Ptr(0),
    f_c_Equ_tnode_Node_Ptr(0),
    f_ci_Equ_c_Node_Ptr(0),
    f_c_Equ_ci_Node_Ptr(0),
    f_c_Equ_c_Node_Ptr(0),
    f_bi_Equ_b_Node_Ptr(0),
    f_b_Equ_ei_Node_Ptr(0),
    f_bi_Equ_tnode_Node_Ptr(0),
    f_bi_Equ_xf_Node_Ptr(0),
    f_ei_Equ_xf_Node_Ptr(0),
    f_ei_Equ_b_Node_Ptr(0),
    f_ci_Equ_xf2_Node_Ptr(0),
    f_ei_Equ_xf2_Node_Ptr(0),
    f_tnode_Equ_tnode_Node_Ptr(0),
    f_tnode_Equ_ci_Node_Ptr(0),
    f_tnode_Equ_ei_Node_Ptr(0),
    f_tnode_Equ_b_Node_Ptr(0),
    f_tnode_Equ_bi_Node_Ptr(0),
    f_tnode_Equ_s_Node_Ptr(0),
    f_tnode_Equ_e_Node_Ptr(0),
    f_tnode_Equ_c_Node_Ptr(0),
    f_xf1_Equ_ci_Node_Ptr(0),
    f_xf1_Equ_ei_Node_Ptr(0),
    f_xf1_Equ_b_Node_Ptr(0),
    f_xf1_Equ_bi_Node_Ptr(0),
    f_xf1_Equ_tnode_Node_Ptr(0),
    f_xf1_Equ_xf2_Node_Ptr(0),
    f_xf1_Equ_xf1_Node_Ptr(0),
    f_xf2_Equ_bi_Node_Ptr(0),
    f_xf2_Equ_ei_Node_Ptr(0),
    f_xf2_Equ_ci_Node_Ptr(0),
    f_xf2_Equ_b_Node_Ptr(0),
    f_xf2_Equ_tnode_Node_Ptr(0),
    f_xf2_Equ_xf1_Node_Ptr(0),
    f_xf2_Equ_xf2_Node_Ptr(0),
    f_xf_Equ_ci_Node_Ptr(0),
    f_xf_Equ_ei_Node_Ptr(0),
    f_xf_Equ_bi_Node_Ptr(0),
    f_xf_Equ_b_Node_Ptr(0),
    f_xf_Equ_tnode_Node_Ptr(0),
    f_xf_Equ_xf_Node_Ptr(0),
    q_bi_Equ_bi_Node_Ptr(0),
    q_bi_Equ_ei_Node_Ptr(0),
    q_ei_Equ_bi_Node_Ptr(0),
    q_ei_Equ_ei_Node_Ptr(0),
    q_bi_Equ_ci_Node_Ptr(0),
    q_ci_Equ_bi_Node_Ptr(0),
    q_ci_Equ_ci_Node_Ptr(0),
    q_ci_Equ_ei_Node_Ptr(0),
    q_ei_Equ_ci_Node_Ptr(0),
    q_b_Equ_s_Node_Ptr(0),
    q_b_Equ_ci_Node_Ptr(0),
    q_s_Equ_s_Node_Ptr(0),
    q_s_Equ_ci_Node_Ptr(0),
    q_b_Equ_b_Node_Ptr(0),
    q_s_Equ_b_Node_Ptr(0),
    q_b_Equ_tnode_Node_Ptr(0),
    q_s_Equ_tnode_Node_Ptr(0),
    q_s_Equ_bi_Node_Ptr(0),
    q_s_Equ_ei_Node_Ptr(0),
    q_ci_Equ_s_Node_Ptr(0),
    q_ci_Equ_tnode_Node_Ptr(0),
    q_ci_Equ_b_Node_Ptr(0),
    q_b_Equ_bi_Node_Ptr(0),
    q_b_Equ_e_Node_Ptr(0),
    q_e_Equ_b_Node_Ptr(0),
    q_e_Equ_e_Node_Ptr(0),
    q_ei_Equ_tnode_Node_Ptr(0),
    q_e_Equ_tnode_Node_Ptr(0),
    q_ei_Equ_e_Node_Ptr(0),
    q_e_Equ_ei_Node_Ptr(0),
    q_c_Equ_tnode_Node_Ptr(0),
    q_ci_Equ_c_Node_Ptr(0),
    q_c_Equ_ci_Node_Ptr(0),
    q_c_Equ_c_Node_Ptr(0),
    q_bi_Equ_b_Node_Ptr(0),
    q_b_Equ_ei_Node_Ptr(0),
    q_bi_Equ_tnode_Node_Ptr(0),
    q_bi_Equ_xf_Node_Ptr(0),
    q_ei_Equ_xf_Node_Ptr(0),
    q_ei_Equ_b_Node_Ptr(0),
    q_ci_Equ_xf2_Node_Ptr(0),
    q_ei_Equ_xf2_Node_Ptr(0),
    q_tnode_Equ_tnode_Node_Ptr(0),
    q_tnode_Equ_ci_Node_Ptr(0),
    q_tnode_Equ_ei_Node_Ptr(0),
    q_tnode_Equ_b_Node_Ptr(0),
    q_tnode_Equ_bi_Node_Ptr(0),
    q_tnode_Equ_s_Node_Ptr(0),
    q_tnode_Equ_e_Node_Ptr(0),
    q_tnode_Equ_c_Node_Ptr(0),
    q_xf1_Equ_ci_Node_Ptr(0),
    q_xf1_Equ_ei_Node_Ptr(0),
    q_xf1_Equ_b_Node_Ptr(0),
    q_xf1_Equ_bi_Node_Ptr(0),
    q_xf1_Equ_tnode_Node_Ptr(0),
    q_xf1_Equ_xf2_Node_Ptr(0),
    q_xf1_Equ_xf1_Node_Ptr(0),
    q_xf2_Equ_bi_Node_Ptr(0),
    q_xf2_Equ_ei_Node_Ptr(0),
    q_xf2_Equ_ci_Node_Ptr(0),
    q_xf2_Equ_b_Node_Ptr(0),
    q_xf2_Equ_tnode_Node_Ptr(0),
    q_xf2_Equ_xf1_Node_Ptr(0),
    q_xf2_Equ_xf2_Node_Ptr(0),
    q_xf_Equ_ci_Node_Ptr(0),
    q_xf_Equ_ei_Node_Ptr(0),
    q_xf_Equ_bi_Node_Ptr(0),
    q_xf_Equ_b_Node_Ptr(0),
    q_xf_Equ_tnode_Node_Ptr(0),
    q_xf_Equ_xf_Node_Ptr(0),
    A_bi_Equ_bi_NodeOffset(-1),
    A_bi_Equ_ei_NodeOffset(-1),
    A_ei_Equ_bi_NodeOffset(-1),
    A_ei_Equ_ei_NodeOffset(-1),
    A_bi_Equ_ci_NodeOffset(-1),
    A_ci_Equ_bi_NodeOffset(-1),
    A_ci_Equ_ci_NodeOffset(-1),
    A_ci_Equ_ei_NodeOffset(-1),
    A_ei_Equ_ci_NodeOffset(-1),
    A_b_Equ_s_NodeOffset(-1),
    A_b_Equ_ci_NodeOffset(-1),
    A_s_Equ_s_NodeOffset(-1),
    A_s_Equ_ci_NodeOffset(-1),
    A_b_Equ_b_NodeOffset(-1),
    A_s_Equ_b_NodeOffset(-1),
    A_b_Equ_tnode_NodeOffset(-1),
    A_s_Equ_tnode_NodeOffset(-1),
    A_s_Equ_bi_NodeOffset(-1),
    A_s_Equ_ei_NodeOffset(-1),
    A_ci_Equ_s_NodeOffset(-1),
    A_ci_Equ_tnode_NodeOffset(-1),
    A_ci_Equ_b_NodeOffset(-1),
    A_b_Equ_bi_NodeOffset(-1),
    A_b_Equ_e_NodeOffset(-1),
    A_e_Equ_b_NodeOffset(-1),
    A_e_Equ_e_NodeOffset(-1),
    A_ei_Equ_tnode_NodeOffset(-1),
    A_e_Equ_tnode_NodeOffset(-1),
    A_ei_Equ_e_NodeOffset(-1),
    A_e_Equ_ei_NodeOffset(-1),
    A_c_Equ_tnode_NodeOffset(-1),
    A_ci_Equ_c_NodeOffset(-1),
    A_c_Equ_ci_NodeOffset(-1),
    A_c_Equ_c_NodeOffset(-1),
    A_bi_Equ_b_NodeOffset(-1),
    A_b_Equ_ei_NodeOffset(-1),
    A_bi_Equ_tnode_NodeOffset(-1),
    A_bi_Equ_xf_NodeOffset(-1),
    A_ei_Equ_xf_NodeOffset(-1),
    A_ei_Equ_b_NodeOffset(-1),
    A_ci_Equ_xf2_NodeOffset(-1),
    A_ei_Equ_xf2_NodeOffset(-1),
    A_tnode_Equ_tnode_NodeOffset(-1),
    A_tnode_Equ_ci_NodeOffset(-1),
    A_tnode_Equ_ei_NodeOffset(-1),
    A_tnode_Equ_b_NodeOffset(-1),
    A_tnode_Equ_bi_NodeOffset(-1),
    A_tnode_Equ_s_NodeOffset(-1),
    A_tnode_Equ_e_NodeOffset(-1),
    A_tnode_Equ_c_NodeOffset(-1),
    A_xf1_Equ_ci_NodeOffset(-1),
    A_xf1_Equ_ei_NodeOffset(-1),
    A_xf1_Equ_b_NodeOffset(-1),
    A_xf1_Equ_bi_NodeOffset(-1),
    A_xf1_Equ_tnode_NodeOffset(-1),
    A_xf1_Equ_xf2_NodeOffset(-1),
    A_xf1_Equ_xf1_NodeOffset(-1),
    A_xf2_Equ_bi_NodeOffset(-1),
    A_xf2_Equ_ei_NodeOffset(-1),
    A_xf2_Equ_ci_NodeOffset(-1),
    A_xf2_Equ_b_NodeOffset(-1),
    A_xf2_Equ_tnode_NodeOffset(-1),
    A_xf2_Equ_xf1_NodeOffset(-1),
    A_xf2_Equ_xf2_NodeOffset(-1),
    A_xf_Equ_ci_NodeOffset(-1),
    A_xf_Equ_ei_NodeOffset(-1),
    A_xf_Equ_bi_NodeOffset(-1),
    A_xf_Equ_b_NodeOffset(-1),
    A_xf_Equ_tnode_NodeOffset(-1),
    A_xf_Equ_xf_NodeOffset(-1),
    li_store_qjci(-1),
    li_store_qjei(-1),
    li_store_it(-1),
    li_store_ijbc(-1),
    li_store_iavl(-1),
    li_store_ijsc(-1),
    li_store_Ibici(-1),
    li_store_ijbe(-1),
    li_store_IAVL(-1),
    li_store_VBE(-1),
    li_store_VBC(-1),
    li_store_VCE(-1),
    li_store_VSC(-1),
    li_store_GMi(-1),
    li_store_RPIi(-1),
    li_store_RMUi(-1),
    li_store_ROi(-1),
    li_store_CPIi(-1),
    li_store_CMUi(-1),
    li_store_CBCX(-1),
    li_store_CCS(-1),
    li_store_RBi(-1),
    li_store_RB(-1),
    li_store_RCX(-1),
    li_store_RE(-1),
    li_store_BETAAC(-1),
    li_store_TF(-1),
    li_store_FT(-1),
    collapseNode_ci(false),
    collapseNode_bi(false),
    collapseNode_ei(false),
    admsTemperature(getDeviceOptions().temp.getImmutableValue<double>())

{
    numIntVars = 6 + 0;
    numExtVars = 5;

  // Right now, we only have store for limited probes and output vars...
  setNumStoreVars(0+28);

  // Do not allocate "branch" (lead current) vectors by default
  setNumBranchDataVars(0);
  numBranchDataVarsIfAllocated = 5;

  leadCurrentF.resize(5);
  leadCurrentQ.resize(5);

  // Set up jacobian stamp:
  // Create a vector of the non-zero elements of the stamp
PairVector jacobianElements;
    jacobianElements.push_back(IntPair(admsNodeID_c,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_c,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_c,admsNodeID_c));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_s));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_e));
    jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_e,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_e,admsNodeID_e));
    jacobianElements.push_back(IntPair(admsNodeID_e,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_e,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_s));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_s,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_s));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_e));
    jacobianElements.push_back(IntPair(admsNodeID_tnode,admsNodeID_c));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_s));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_c));
    jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_xf2));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_xf));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_e));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_xf));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_xf2));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_xf2));
    jacobianElements.push_back(IntPair(admsNodeID_xf1,admsNodeID_xf1));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_xf1));
    jacobianElements.push_back(IntPair(admsNodeID_xf2,admsNodeID_xf2));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_ci));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_ei));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_bi));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_b));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_tnode));
    jacobianElements.push_back(IntPair(admsNodeID_xf,admsNodeID_xf));



  setDefaultParams();
  setParams(instance_block.params);

  // Real bogosity here...
  if (!given("XYCEADMSINSTTEMP"))
    admsInstTemp=getDeviceOptions().temp.getImmutableValue<double>();

  //calculate any parameters specified as expressions
  updateDependentParameters();

  // calculate dependent (i.e. computed params) and check for errors.
  processParams();

  PairVector collapsedNodes;
  collapseNodes();

  if (collapseNode_ci)
  {
  collapsedNodes.push_back(IntPair(admsNodeID_ci,admsNodeID_c));
  }
  if (collapseNode_bi)
  {
  collapsedNodes.push_back(IntPair(admsNodeID_bi,admsNodeID_b));
  }
  if (collapseNode_ei)
  {
  collapsedNodes.push_back(IntPair(admsNodeID_ei,admsNodeID_e));
  }

// Now generate the jacstamp from what we already have.
// This jacstamp will have all the correct node mapping.  map will be the nodal mapping of original
// node IDs to row/column ids in the reduced (non-sparse) representation of the jacobian.
// (for devices that have no collapsibles, this will be static, so check that it hasn't already
// been filled in)
if (jacStamp.empty())
{
int originalSize = 11+0;
computeJacStampAndMaps(jacobianElements,collapsedNodes,jacStamp,nodeMap,pairToJacStampMap,originalSize);
}

}

//-----------------------------------------------------------------------------
// Function      : Instance::collapseNodes
// Purpose       : function to handle collapsing of nodes
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::collapseNodes()
{
collapseNode_ci = false;
collapseNode_bi = false;
collapseNode_ei = false;
if (!(((model_.re)>=0.001)))
{

collapseNode_ei = true;

}

if (!(((model_.rcx)>=0.001)))
{

collapseNode_ci = true;

}

if (!((((model_.rbi0)>=0.001)||((model_.rbx)>=0.001))))
{

collapseNode_bi = true;

}


  if (collapseNode_ci)
  {
    numIntVars--;
  }
  if (collapseNode_bi)
  {
    numIntVars--;
  }
  if (collapseNode_ei)
  {
    numIntVars--;
  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::~Instance
// Purpose       : destructor
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
Instance::~Instance()
{
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerLIDs
// Purpose       : function for registering, and setting up, local IDs.
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerLIDs( const LocalIdVector & intLIDVecRef,
                             const LocalIdVector & extLIDVecRef)
{
  AssertLIDs(intLIDVecRef.size() == numIntVars);
  AssertLIDs(extLIDVecRef.size() == numExtVars);

  LocalIdVector localLIDVec;

  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
  {
    Xyce::dout() << std::endl << section_divider << std::endl
                 << "In ADMShic0_full::Instance::register LIDs\n\n"
                 << "name             = " << getName() << std::endl
                 << "number of internal variables: " << numIntVars << std::endl
                 << "number of external variables: " << numExtVars << std::endl;
  }

  // copy over the global ID lists into a local array.
  // The end result of this is an array of LIDs corresponding to all the
  // nodes we actually have, in the order that topology thinks of them
  intLIDVec = intLIDVecRef;
  extLIDVec = extLIDVecRef;
  localLIDVec.resize(numExtVars+numIntVars);
  for (int localNodeIndex=0;localNodeIndex<numExtVars;++localNodeIndex)
  {
    localLIDVec[localNodeIndex]=extLIDVec[localNodeIndex];
  }
  for (int localNodeIndex=numExtVars;localNodeIndex<numExtVars+numIntVars;++localNodeIndex)
  {
    localLIDVec[localNodeIndex]=intLIDVec[localNodeIndex-numExtVars];
    }

  // Now pull the LIDs for each of our nodes out of the local array.
  // Use the node mapping created by createJacStampAndMaps to handle
  // all the node collapse complications.
  li_c = localLIDVec[nodeMap[admsNodeID_c]];
  li_b = localLIDVec[nodeMap[admsNodeID_b]];
  li_e = localLIDVec[nodeMap[admsNodeID_e]];
  li_s = localLIDVec[nodeMap[admsNodeID_s]];
  li_tnode = localLIDVec[nodeMap[admsNodeID_tnode]];
  li_ci = localLIDVec[nodeMap[admsNodeID_ci]];
  li_bi = localLIDVec[nodeMap[admsNodeID_bi]];
  li_ei = localLIDVec[nodeMap[admsNodeID_ei]];
  li_xf1 = localLIDVec[nodeMap[admsNodeID_xf1]];
  li_xf2 = localLIDVec[nodeMap[admsNodeID_xf2]];
  li_xf = localLIDVec[nodeMap[admsNodeID_xf]];


  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
  {
    Xyce::dout() << "\nSolution and RHS variables:\n";
      Xyce::dout() << "\nli_c = " << li_c << std::endl;
      Xyce::dout() << "\nli_b = " << li_b << std::endl;
      Xyce::dout() << "\nli_e = " << li_e << std::endl;
      Xyce::dout() << "\nli_s = " << li_s << std::endl;
      Xyce::dout() << "\nli_tnode = " << li_tnode << std::endl;
      Xyce::dout() << "\nli_ci = " << li_ci << std::endl;
      Xyce::dout() << "\nli_bi = " << li_bi << std::endl;
      Xyce::dout() << "\nli_ei = " << li_ei << std::endl;
      Xyce::dout() << "\nli_xf1 = " << li_xf1 << std::endl;
      Xyce::dout() << "\nli_xf2 = " << li_xf2 << std::endl;
      Xyce::dout() << "\nli_xf = " << li_xf << std::endl;

    Xyce::dout() << "\nEnd of ADMShic0_full::Instance::register LIDs\n";
    Xyce::dout() << section_divider << std::endl;
  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::loadNodeSymbols
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::loadNodeSymbols(Util::SymbolTable &symbol_table) const
{
    if (!collapseNode_ci)
    {
    addInternalNode(symbol_table, li_ci, getName(), "ci");
    }
    if (!collapseNode_bi)
    {
    addInternalNode(symbol_table, li_bi, getName(), "bi");
    }
    if (!collapseNode_ei)
    {
    addInternalNode(symbol_table, li_ei, getName(), "ei");
    }
    addInternalNode(symbol_table, li_xf1, getName(), "xf1");
    addInternalNode(symbol_table, li_xf2, getName(), "xf2");
    addInternalNode(symbol_table, li_xf, getName(), "xf");
    addStoreNode(symbol_table, li_store_qjci, getName().getEncodedName() + ":qjci");
    addStoreNode(symbol_table, li_store_qjei, getName().getEncodedName() + ":qjei");
    addStoreNode(symbol_table, li_store_it, getName().getEncodedName() + ":it");
    addStoreNode(symbol_table, li_store_ijbc, getName().getEncodedName() + ":ijbc");
    addStoreNode(symbol_table, li_store_iavl, getName().getEncodedName() + ":iavl");
    addStoreNode(symbol_table, li_store_ijsc, getName().getEncodedName() + ":ijsc");
    addStoreNode(symbol_table, li_store_Ibici, getName().getEncodedName() + ":Ibici");
    addStoreNode(symbol_table, li_store_ijbe, getName().getEncodedName() + ":ijbe");
    addStoreNode(symbol_table, li_store_IAVL, getName().getEncodedName() + ":IAVL");
    addStoreNode(symbol_table, li_store_VBE, getName().getEncodedName() + ":VBE");
    addStoreNode(symbol_table, li_store_VBC, getName().getEncodedName() + ":VBC");
    addStoreNode(symbol_table, li_store_VCE, getName().getEncodedName() + ":VCE");
    addStoreNode(symbol_table, li_store_VSC, getName().getEncodedName() + ":VSC");
    addStoreNode(symbol_table, li_store_GMi, getName().getEncodedName() + ":GMi");
    addStoreNode(symbol_table, li_store_RPIi, getName().getEncodedName() + ":RPIi");
    addStoreNode(symbol_table, li_store_RMUi, getName().getEncodedName() + ":RMUi");
    addStoreNode(symbol_table, li_store_ROi, getName().getEncodedName() + ":ROi");
    addStoreNode(symbol_table, li_store_CPIi, getName().getEncodedName() + ":CPIi");
    addStoreNode(symbol_table, li_store_CMUi, getName().getEncodedName() + ":CMUi");
    addStoreNode(symbol_table, li_store_CBCX, getName().getEncodedName() + ":CBCX");
    addStoreNode(symbol_table, li_store_CCS, getName().getEncodedName() + ":CCS");
    addStoreNode(symbol_table, li_store_RBi, getName().getEncodedName() + ":RBi");
    addStoreNode(symbol_table, li_store_RB, getName().getEncodedName() + ":RB");
    addStoreNode(symbol_table, li_store_RCX, getName().getEncodedName() + ":RCX");
    addStoreNode(symbol_table, li_store_RE, getName().getEncodedName() + ":RE");
    addStoreNode(symbol_table, li_store_BETAAC, getName().getEncodedName() + ":BETAAC");
    addStoreNode(symbol_table, li_store_TF, getName().getEncodedName() + ":TF");
    addStoreNode(symbol_table, li_store_FT, getName().getEncodedName() + ":FT");

  if (loadLeadCurrent)
  {
    addBranchDataNode( symbol_table, li_branch_ic, getName(), "BRANCH_DC");
    addBranchDataNode( symbol_table, li_branch_ib, getName(), "BRANCH_DB");
    addBranchDataNode( symbol_table, li_branch_ie, getName(), "BRANCH_DE");
    addBranchDataNode( symbol_table, li_branch_is, getName(), "BRANCH_D4");
    addBranchDataNode( symbol_table, li_branch_itnode, getName(), "BRANCH_D5");


  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerStoreLIDs
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerStoreLIDs( const LocalIdVector & stoLIDVecRef)
{
  AssertLIDs(stoLIDVecRef.size() == getNumStoreVars());

  int numSto = stoLIDVecRef.size();
  if (numSto > 0)
  {
    int i=0;
    stoLIDVec = stoLIDVecRef;

      li_store_qjci= stoLIDVec[i++];
      li_store_qjei= stoLIDVec[i++];
      li_store_it= stoLIDVec[i++];
      li_store_ijbc= stoLIDVec[i++];
      li_store_iavl= stoLIDVec[i++];
      li_store_ijsc= stoLIDVec[i++];
      li_store_Ibici= stoLIDVec[i++];
      li_store_ijbe= stoLIDVec[i++];
      li_store_IAVL= stoLIDVec[i++];
      li_store_VBE= stoLIDVec[i++];
      li_store_VBC= stoLIDVec[i++];
      li_store_VCE= stoLIDVec[i++];
      li_store_VSC= stoLIDVec[i++];
      li_store_GMi= stoLIDVec[i++];
      li_store_RPIi= stoLIDVec[i++];
      li_store_RMUi= stoLIDVec[i++];
      li_store_ROi= stoLIDVec[i++];
      li_store_CPIi= stoLIDVec[i++];
      li_store_CMUi= stoLIDVec[i++];
      li_store_CBCX= stoLIDVec[i++];
      li_store_CCS= stoLIDVec[i++];
      li_store_RBi= stoLIDVec[i++];
      li_store_RB= stoLIDVec[i++];
      li_store_RCX= stoLIDVec[i++];
      li_store_RE= stoLIDVec[i++];
      li_store_BETAAC= stoLIDVec[i++];
      li_store_TF= stoLIDVec[i++];
      li_store_FT= stoLIDVec[i++];
  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerBranchDataLIDs
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : Eric Keiter, SNL
// Creation Date : 12/09/11
//-----------------------------------------------------------------------------
void Instance::registerBranchDataLIDs(const std::vector<int> & branchLIDVecRef)
{
  AssertLIDs(branchLIDVecRef.size() == getNumBranchDataVars());

  if (loadLeadCurrent)
  {
    int i = 0;
    li_branch_ic = branchLIDVecRef[i++];
    li_branch_ib = branchLIDVecRef[i++];
    li_branch_ie = branchLIDVecRef[i++];
    li_branch_is = branchLIDVecRef[i++];
    li_branch_itnode = branchLIDVecRef[i++];

  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::jacobianStamp
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
const JacobianStamp & Instance::jacobianStamp() const
{
    return jacStamp;
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerJacLIDs
// Purpose       : Create Offset variables used for referencing jacobian
//                 elements
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerJacLIDs( const JacobianStamp & jacLIDVec)
{
  DeviceInstance::registerJacLIDs(jacLIDVec);  IntPair jacLoc;
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_c,admsNodeID_tnode)];
    A_c_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_c,admsNodeID_ci)];
    A_c_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_c,admsNodeID_c)];
    A_c_Equ_c_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_s)];
    A_b_Equ_s_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_ci)];
    A_b_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_b)];
    A_b_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_tnode)];
    A_b_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_bi)];
    A_b_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_e)];
    A_b_Equ_e_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_ei)];
    A_b_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_e,admsNodeID_b)];
    A_e_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_e,admsNodeID_e)];
    A_e_Equ_e_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_e,admsNodeID_tnode)];
    A_e_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_e,admsNodeID_ei)];
    A_e_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_s)];
    A_s_Equ_s_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_ci)];
    A_s_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_b)];
    A_s_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_tnode)];
    A_s_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_bi)];
    A_s_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_s,admsNodeID_ei)];
    A_s_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_tnode)];
    A_tnode_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_ci)];
    A_tnode_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_ei)];
    A_tnode_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_b)];
    A_tnode_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_bi)];
    A_tnode_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_s)];
    A_tnode_Equ_s_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_e)];
    A_tnode_Equ_e_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_tnode,admsNodeID_c)];
    A_tnode_Equ_c_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_bi)];
    A_ci_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_ci)];
    A_ci_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_ei)];
    A_ci_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_s)];
    A_ci_Equ_s_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_tnode)];
    A_ci_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_b)];
    A_ci_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_c)];
    A_ci_Equ_c_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_xf2)];
    A_ci_Equ_xf2_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_bi)];
    A_bi_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_ei)];
    A_bi_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_ci)];
    A_bi_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_b)];
    A_bi_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_tnode)];
    A_bi_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_xf)];
    A_bi_Equ_xf_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_bi)];
    A_ei_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ei)];
    A_ei_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ci)];
    A_ei_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_tnode)];
    A_ei_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_e)];
    A_ei_Equ_e_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_xf)];
    A_ei_Equ_xf_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_b)];
    A_ei_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_xf2)];
    A_ei_Equ_xf2_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_ci)];
    A_xf1_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_ei)];
    A_xf1_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_b)];
    A_xf1_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_bi)];
    A_xf1_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_tnode)];
    A_xf1_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_xf2)];
    A_xf1_Equ_xf2_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf1,admsNodeID_xf1)];
    A_xf1_Equ_xf1_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_bi)];
    A_xf2_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_ei)];
    A_xf2_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_ci)];
    A_xf2_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_b)];
    A_xf2_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_tnode)];
    A_xf2_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_xf1)];
    A_xf2_Equ_xf1_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf2,admsNodeID_xf2)];
    A_xf2_Equ_xf2_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_ci)];
    A_xf_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_ei)];
    A_xf_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_bi)];
    A_xf_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_b)];
    A_xf_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_tnode)];
    A_xf_Equ_tnode_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
    jacLoc = pairToJacStampMap[IntPair(admsNodeID_xf,admsNodeID_xf)];
    A_xf_Equ_xf_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];


}

//-----------------------------------------------------------------------------
// Function      : Instance::setupPointers
// Purpose       : Create pointer variables used for referencing jacobian
//                 elements
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::setupPointers( )
{

  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);
    f_c_Equ_tnode_Node_Ptr = &(dFdx[li_c][A_c_Equ_tnode_NodeOffset]);
    q_c_Equ_tnode_Node_Ptr = &(dQdx[li_c][A_c_Equ_tnode_NodeOffset]);
    f_c_Equ_ci_Node_Ptr = &(dFdx[li_c][A_c_Equ_ci_NodeOffset]);
    q_c_Equ_ci_Node_Ptr = &(dQdx[li_c][A_c_Equ_ci_NodeOffset]);
    f_c_Equ_c_Node_Ptr = &(dFdx[li_c][A_c_Equ_c_NodeOffset]);
    q_c_Equ_c_Node_Ptr = &(dQdx[li_c][A_c_Equ_c_NodeOffset]);
    f_b_Equ_s_Node_Ptr = &(dFdx[li_b][A_b_Equ_s_NodeOffset]);
    q_b_Equ_s_Node_Ptr = &(dQdx[li_b][A_b_Equ_s_NodeOffset]);
    f_b_Equ_ci_Node_Ptr = &(dFdx[li_b][A_b_Equ_ci_NodeOffset]);
    q_b_Equ_ci_Node_Ptr = &(dQdx[li_b][A_b_Equ_ci_NodeOffset]);
    f_b_Equ_b_Node_Ptr = &(dFdx[li_b][A_b_Equ_b_NodeOffset]);
    q_b_Equ_b_Node_Ptr = &(dQdx[li_b][A_b_Equ_b_NodeOffset]);
    f_b_Equ_tnode_Node_Ptr = &(dFdx[li_b][A_b_Equ_tnode_NodeOffset]);
    q_b_Equ_tnode_Node_Ptr = &(dQdx[li_b][A_b_Equ_tnode_NodeOffset]);
    f_b_Equ_bi_Node_Ptr = &(dFdx[li_b][A_b_Equ_bi_NodeOffset]);
    q_b_Equ_bi_Node_Ptr = &(dQdx[li_b][A_b_Equ_bi_NodeOffset]);
    f_b_Equ_e_Node_Ptr = &(dFdx[li_b][A_b_Equ_e_NodeOffset]);
    q_b_Equ_e_Node_Ptr = &(dQdx[li_b][A_b_Equ_e_NodeOffset]);
    f_b_Equ_ei_Node_Ptr = &(dFdx[li_b][A_b_Equ_ei_NodeOffset]);
    q_b_Equ_ei_Node_Ptr = &(dQdx[li_b][A_b_Equ_ei_NodeOffset]);
    f_e_Equ_b_Node_Ptr = &(dFdx[li_e][A_e_Equ_b_NodeOffset]);
    q_e_Equ_b_Node_Ptr = &(dQdx[li_e][A_e_Equ_b_NodeOffset]);
    f_e_Equ_e_Node_Ptr = &(dFdx[li_e][A_e_Equ_e_NodeOffset]);
    q_e_Equ_e_Node_Ptr = &(dQdx[li_e][A_e_Equ_e_NodeOffset]);
    f_e_Equ_tnode_Node_Ptr = &(dFdx[li_e][A_e_Equ_tnode_NodeOffset]);
    q_e_Equ_tnode_Node_Ptr = &(dQdx[li_e][A_e_Equ_tnode_NodeOffset]);
    f_e_Equ_ei_Node_Ptr = &(dFdx[li_e][A_e_Equ_ei_NodeOffset]);
    q_e_Equ_ei_Node_Ptr = &(dQdx[li_e][A_e_Equ_ei_NodeOffset]);
    f_s_Equ_s_Node_Ptr = &(dFdx[li_s][A_s_Equ_s_NodeOffset]);
    q_s_Equ_s_Node_Ptr = &(dQdx[li_s][A_s_Equ_s_NodeOffset]);
    f_s_Equ_ci_Node_Ptr = &(dFdx[li_s][A_s_Equ_ci_NodeOffset]);
    q_s_Equ_ci_Node_Ptr = &(dQdx[li_s][A_s_Equ_ci_NodeOffset]);
    f_s_Equ_b_Node_Ptr = &(dFdx[li_s][A_s_Equ_b_NodeOffset]);
    q_s_Equ_b_Node_Ptr = &(dQdx[li_s][A_s_Equ_b_NodeOffset]);
    f_s_Equ_tnode_Node_Ptr = &(dFdx[li_s][A_s_Equ_tnode_NodeOffset]);
    q_s_Equ_tnode_Node_Ptr = &(dQdx[li_s][A_s_Equ_tnode_NodeOffset]);
    f_s_Equ_bi_Node_Ptr = &(dFdx[li_s][A_s_Equ_bi_NodeOffset]);
    q_s_Equ_bi_Node_Ptr = &(dQdx[li_s][A_s_Equ_bi_NodeOffset]);
    f_s_Equ_ei_Node_Ptr = &(dFdx[li_s][A_s_Equ_ei_NodeOffset]);
    q_s_Equ_ei_Node_Ptr = &(dQdx[li_s][A_s_Equ_ei_NodeOffset]);
    f_tnode_Equ_tnode_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_tnode_NodeOffset]);
    q_tnode_Equ_tnode_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_tnode_NodeOffset]);
    f_tnode_Equ_ci_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_ci_NodeOffset]);
    q_tnode_Equ_ci_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_ci_NodeOffset]);
    f_tnode_Equ_ei_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_ei_NodeOffset]);
    q_tnode_Equ_ei_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_ei_NodeOffset]);
    f_tnode_Equ_b_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_b_NodeOffset]);
    q_tnode_Equ_b_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_b_NodeOffset]);
    f_tnode_Equ_bi_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_bi_NodeOffset]);
    q_tnode_Equ_bi_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_bi_NodeOffset]);
    f_tnode_Equ_s_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_s_NodeOffset]);
    q_tnode_Equ_s_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_s_NodeOffset]);
    f_tnode_Equ_e_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_e_NodeOffset]);
    q_tnode_Equ_e_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_e_NodeOffset]);
    f_tnode_Equ_c_Node_Ptr = &(dFdx[li_tnode][A_tnode_Equ_c_NodeOffset]);
    q_tnode_Equ_c_Node_Ptr = &(dQdx[li_tnode][A_tnode_Equ_c_NodeOffset]);
    f_ci_Equ_bi_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_bi_NodeOffset]);
    q_ci_Equ_bi_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_bi_NodeOffset]);
    f_ci_Equ_ci_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_ci_NodeOffset]);
    q_ci_Equ_ci_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_ci_NodeOffset]);
    f_ci_Equ_ei_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_ei_NodeOffset]);
    q_ci_Equ_ei_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_ei_NodeOffset]);
    f_ci_Equ_s_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_s_NodeOffset]);
    q_ci_Equ_s_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_s_NodeOffset]);
    f_ci_Equ_tnode_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_tnode_NodeOffset]);
    q_ci_Equ_tnode_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_tnode_NodeOffset]);
    f_ci_Equ_b_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_b_NodeOffset]);
    q_ci_Equ_b_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_b_NodeOffset]);
    f_ci_Equ_c_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_c_NodeOffset]);
    q_ci_Equ_c_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_c_NodeOffset]);
    f_ci_Equ_xf2_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_xf2_NodeOffset]);
    q_ci_Equ_xf2_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_xf2_NodeOffset]);
    f_bi_Equ_bi_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_bi_NodeOffset]);
    q_bi_Equ_bi_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_bi_NodeOffset]);
    f_bi_Equ_ei_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_ei_NodeOffset]);
    q_bi_Equ_ei_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_ei_NodeOffset]);
    f_bi_Equ_ci_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_ci_NodeOffset]);
    q_bi_Equ_ci_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_ci_NodeOffset]);
    f_bi_Equ_b_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_b_NodeOffset]);
    q_bi_Equ_b_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_b_NodeOffset]);
    f_bi_Equ_tnode_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_tnode_NodeOffset]);
    q_bi_Equ_tnode_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_tnode_NodeOffset]);
    f_bi_Equ_xf_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_xf_NodeOffset]);
    q_bi_Equ_xf_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_xf_NodeOffset]);
    f_ei_Equ_bi_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_bi_NodeOffset]);
    q_ei_Equ_bi_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_bi_NodeOffset]);
    f_ei_Equ_ei_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ei_NodeOffset]);
    q_ei_Equ_ei_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ei_NodeOffset]);
    f_ei_Equ_ci_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ci_NodeOffset]);
    q_ei_Equ_ci_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ci_NodeOffset]);
    f_ei_Equ_tnode_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_tnode_NodeOffset]);
    q_ei_Equ_tnode_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_tnode_NodeOffset]);
    f_ei_Equ_e_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_e_NodeOffset]);
    q_ei_Equ_e_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_e_NodeOffset]);
    f_ei_Equ_xf_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_xf_NodeOffset]);
    q_ei_Equ_xf_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_xf_NodeOffset]);
    f_ei_Equ_b_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_b_NodeOffset]);
    q_ei_Equ_b_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_b_NodeOffset]);
    f_ei_Equ_xf2_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_xf2_NodeOffset]);
    q_ei_Equ_xf2_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_xf2_NodeOffset]);
    f_xf1_Equ_ci_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_ci_NodeOffset]);
    q_xf1_Equ_ci_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_ci_NodeOffset]);
    f_xf1_Equ_ei_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_ei_NodeOffset]);
    q_xf1_Equ_ei_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_ei_NodeOffset]);
    f_xf1_Equ_b_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_b_NodeOffset]);
    q_xf1_Equ_b_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_b_NodeOffset]);
    f_xf1_Equ_bi_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_bi_NodeOffset]);
    q_xf1_Equ_bi_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_bi_NodeOffset]);
    f_xf1_Equ_tnode_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_tnode_NodeOffset]);
    q_xf1_Equ_tnode_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_tnode_NodeOffset]);
    f_xf1_Equ_xf2_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_xf2_NodeOffset]);
    q_xf1_Equ_xf2_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_xf2_NodeOffset]);
    f_xf1_Equ_xf1_Node_Ptr = &(dFdx[li_xf1][A_xf1_Equ_xf1_NodeOffset]);
    q_xf1_Equ_xf1_Node_Ptr = &(dQdx[li_xf1][A_xf1_Equ_xf1_NodeOffset]);
    f_xf2_Equ_bi_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_bi_NodeOffset]);
    q_xf2_Equ_bi_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_bi_NodeOffset]);
    f_xf2_Equ_ei_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_ei_NodeOffset]);
    q_xf2_Equ_ei_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_ei_NodeOffset]);
    f_xf2_Equ_ci_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_ci_NodeOffset]);
    q_xf2_Equ_ci_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_ci_NodeOffset]);
    f_xf2_Equ_b_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_b_NodeOffset]);
    q_xf2_Equ_b_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_b_NodeOffset]);
    f_xf2_Equ_tnode_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_tnode_NodeOffset]);
    q_xf2_Equ_tnode_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_tnode_NodeOffset]);
    f_xf2_Equ_xf1_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_xf1_NodeOffset]);
    q_xf2_Equ_xf1_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_xf1_NodeOffset]);
    f_xf2_Equ_xf2_Node_Ptr = &(dFdx[li_xf2][A_xf2_Equ_xf2_NodeOffset]);
    q_xf2_Equ_xf2_Node_Ptr = &(dQdx[li_xf2][A_xf2_Equ_xf2_NodeOffset]);
    f_xf_Equ_ci_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_ci_NodeOffset]);
    q_xf_Equ_ci_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_ci_NodeOffset]);
    f_xf_Equ_ei_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_ei_NodeOffset]);
    q_xf_Equ_ei_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_ei_NodeOffset]);
    f_xf_Equ_bi_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_bi_NodeOffset]);
    q_xf_Equ_bi_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_bi_NodeOffset]);
    f_xf_Equ_b_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_b_NodeOffset]);
    q_xf_Equ_b_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_b_NodeOffset]);
    f_xf_Equ_tnode_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_tnode_NodeOffset]);
    q_xf_Equ_tnode_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_tnode_NodeOffset]);
    f_xf_Equ_xf_Node_Ptr = &(dFdx[li_xf][A_xf_Equ_xf_NodeOffset]);
    q_xf_Equ_xf_Node_Ptr = &(dQdx[li_xf][A_xf_Equ_xf_NodeOffset]);


}

// RHS load functions

//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEFVector
// Purpose       : load F vector (static contributions) for one instance for
//                 NEW DAE formulation
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEFVector()
{

  bool bsuccess=true;
(*extData.daeFVectorPtr)[li_c] += staticContributions[admsNodeID_c];
(*extData.daeFVectorPtr)[li_b] += staticContributions[admsNodeID_b];
(*extData.daeFVectorPtr)[li_e] += staticContributions[admsNodeID_e];
(*extData.daeFVectorPtr)[li_s] += staticContributions[admsNodeID_s];
(*extData.daeFVectorPtr)[li_tnode] += staticContributions[admsNodeID_tnode];
(*extData.daeFVectorPtr)[li_ci] += staticContributions[admsNodeID_ci];
(*extData.daeFVectorPtr)[li_bi] += staticContributions[admsNodeID_bi];
(*extData.daeFVectorPtr)[li_ei] += staticContributions[admsNodeID_ei];
(*extData.daeFVectorPtr)[li_xf1] += staticContributions[admsNodeID_xf1];
(*extData.daeFVectorPtr)[li_xf2] += staticContributions[admsNodeID_xf2];
(*extData.daeFVectorPtr)[li_xf] += staticContributions[admsNodeID_xf];


  if (loadLeadCurrent)
  {
    double * leadF = extData.nextLeadCurrFCompRawPtr;
    leadF[li_branch_ic] = leadCurrentF[admsNodeID_c];
    leadF[li_branch_ib] = leadCurrentF[admsNodeID_b];
    leadF[li_branch_ie] = leadCurrentF[admsNodeID_e];
    leadF[li_branch_is] = leadCurrentF[admsNodeID_s];
    leadF[li_branch_itnode] = leadCurrentF[admsNodeID_tnode];



    // here we have to do special things for BJTs, MOSFETs and 2-terminal
    // devices for power computation.

        double * solVec = extData.nextSolVectorRawPtr;
        double * junctionV = extData.nextJunctionVCompRawPtr;
        junctionV[li_branch_ic] = solVec[li_c] - solVec[li_e];
        junctionV[li_branch_ib] = solVec[li_b] - solVec[li_e];

  }
  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEQVector
// Purpose       : load Q vector (dynamic contributions) for one instance for
//                 NEW DAE formulation
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEQVector()
{
(*extData.daeQVectorPtr)[li_c] += dynamicContributions[admsNodeID_c];
(*extData.daeQVectorPtr)[li_b] += dynamicContributions[admsNodeID_b];
(*extData.daeQVectorPtr)[li_e] += dynamicContributions[admsNodeID_e];
(*extData.daeQVectorPtr)[li_s] += dynamicContributions[admsNodeID_s];
(*extData.daeQVectorPtr)[li_tnode] += dynamicContributions[admsNodeID_tnode];
(*extData.daeQVectorPtr)[li_ci] += dynamicContributions[admsNodeID_ci];
(*extData.daeQVectorPtr)[li_bi] += dynamicContributions[admsNodeID_bi];
(*extData.daeQVectorPtr)[li_ei] += dynamicContributions[admsNodeID_ei];
(*extData.daeQVectorPtr)[li_xf1] += dynamicContributions[admsNodeID_xf1];
(*extData.daeQVectorPtr)[li_xf2] += dynamicContributions[admsNodeID_xf2];
(*extData.daeQVectorPtr)[li_xf] += dynamicContributions[admsNodeID_xf];


  if (loadLeadCurrent)
  {
    double * leadQ = extData.nextLeadCurrQCompRawPtr;
    leadQ[li_branch_ic] = leadCurrentQ[admsNodeID_c];
    leadQ[li_branch_ib] = leadCurrentQ[admsNodeID_b];
    leadQ[li_branch_ie] = leadCurrentQ[admsNodeID_e];
    leadQ[li_branch_is] = leadCurrentQ[admsNodeID_s];
    leadQ[li_branch_itnode] = leadCurrentQ[admsNodeID_tnode];


  }
  return true;
}


//-----------------------------------------------------------------------------
// Function      : Instance::updatePrimaryState
// Purpose       :
// Special Notes : In this initial implementation, does little more than
//                 call updateIntermediateVars()
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updatePrimaryState()
{
  bool bsuccess = true;

  bsuccess = updateIntermediateVars();

  // if old DAE were implemented, we'd save dynamic contributions as state
  // here.

  double * stoVec = extData.nextStoVectorRawPtr;
  // Also need to save limited voltage drops and output vars
  // This formulation assumes that we have *always* written the
  // limited voltages back into the probeVars[] array.

  stoVec[li_store_qjci] = qjci;
  stoVec[li_store_qjei] = qjei;
  stoVec[li_store_it] = it;
  stoVec[li_store_ijbc] = ijbc;
  stoVec[li_store_iavl] = iavl;
  stoVec[li_store_ijsc] = ijsc;
  stoVec[li_store_Ibici] = Ibici;
  stoVec[li_store_ijbe] = ijbe;
  stoVec[li_store_IAVL] = IAVL;
  stoVec[li_store_VBE] = VBE;
  stoVec[li_store_VBC] = VBC;
  stoVec[li_store_VCE] = VCE;
  stoVec[li_store_VSC] = VSC;
  stoVec[li_store_GMi] = GMi;
  stoVec[li_store_RPIi] = RPIi;
  stoVec[li_store_RMUi] = RMUi;
  stoVec[li_store_ROi] = ROi;
  stoVec[li_store_CPIi] = CPIi;
  stoVec[li_store_CMUi] = CMUi;
  stoVec[li_store_CBCX] = CBCX;
  stoVec[li_store_CCS] = CCS;
  stoVec[li_store_RBi] = RBi;
  stoVec[li_store_RB] = RB;
  stoVec[li_store_RCX] = RCX;
  stoVec[li_store_RE] = RE;
  stoVec[li_store_BETAAC] = BETAAC;
  stoVec[li_store_TF] = TF;
  stoVec[li_store_FT] = FT;

  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::updateSecondaryState
// Purpose       :
// Special Notes : In this initial implementation, does nothing
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateSecondaryState()
{
  bool bsuccess = true;

  // were old DAE implemented, we'd pull dynamic contribution derivatives
  // out of state.

  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::updateIntermediateVars
// Purpose       : update intermediate variables for one hic0_full instance
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateIntermediateVars()
{

  bool bsuccess=true;
  Linear::Vector * solVectorPtr = extData.nextSolVectorPtr;

  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
  {
    Xyce::dout() << std::endl << subsection_divider << std::endl;
    Xyce::dout() << "  In ADMShic0_full::Instance::updateIntermediateVars\n\n";
    Xyce::dout() << "  name = " << getName() << std::endl;
  }

  // Local variables
  double flicker_Pwr=0.0;
  double twoq=0.0;
  double fourkt=0.0;
  double it_wop=0.0;
     double d_it_wop_dV_tnode_GND=0.0;
     double d_it_wop_dV_bi_ei=0.0;
     double d_it_wop_dV_bi_ci=0.0;
     double d_it_wop_dV_b_ci=0.0;
     double d_it_wop_dV_ci_ei=0.0;
  double Qbiei=0.0;
     double d_Qbiei_dV_tnode_GND=0.0;
     double d_Qbiei_dV_ci_ei=0.0;
     double d_Qbiei_dV_bi_ei=0.0;
     double d_Qbiei_dV_bi_ci=0.0;
     double d_Qbiei_dV_b_ci=0.0;
     double d_Qbiei_dV_xf_GND=0.0;
  double Qbici=0.0;
     double d_Qbici_dV_bi_ci=0.0;
     double d_Qbici_dV_tnode_GND=0.0;
     double d_Qbici_dV_b_ci=0.0;
     double d_Qbici_dV_bi_ei=0.0;
     double d_Qbici_dV_ci_ei=0.0;
  double Qbe=0.0;
     double d_Qbe_dV_b_e=0.0;
  double Qbci=0.0;
     double d_Qbci_dV_b_ci=0.0;
  double Qxf=0.0;
     double d_Qxf_dV_xf_GND=0.0;
  double Ixf=0.0;
     double d_Ixf_dV_xf_GND=0.0;
     double d_Ixf_dV_tnode_GND=0.0;
     double d_Ixf_dV_bi_ci=0.0;
     double d_Ixf_dV_b_ci=0.0;
     double d_Ixf_dV_bi_ei=0.0;
     double d_Ixf_dV_ci_ei=0.0;
  double fact=0.0;
     double d_fact_dV_tnode_GND=0.0;
     double d_fact_dV_bi_ci=0.0;
     double d_fact_dV_b_ci=0.0;
     double d_fact_dV_ci_ei=0.0;
     double d_fact_dV_bi_ei=0.0;
  double Vxf=0.0;
     double d_Vxf_dV_xf_GND=0.0;
  double Qxf2=0.0;
     double d_Qxf2_dV_xf2_GND=0.0;
  double Qxf1=0.0;
     double d_Qxf1_dV_xf1_GND=0.0;
  double Ixf2=0.0;
     double d_Ixf2_dV_xf2_GND=0.0;
     double d_Ixf2_dV_xf1_GND=0.0;
     double d_Ixf2_dV_tnode_GND=0.0;
     double d_Ixf2_dV_bi_ci=0.0;
     double d_Ixf2_dV_b_ci=0.0;
     double d_Ixf2_dV_ci_ei=0.0;
     double d_Ixf2_dV_bi_ei=0.0;
  double Ixf1=0.0;
     double d_Ixf1_dV_xf1_GND=0.0;
     double d_Ixf1_dV_xf2_GND=0.0;
     double d_Ixf1_dV_tnode_GND=0.0;
     double d_Ixf1_dV_bi_ei=0.0;
     double d_Ixf1_dV_bi_ci=0.0;
     double d_Ixf1_dV_b_ci=0.0;
     double d_Ixf1_dV_ci_ei=0.0;
  double Vxf2=0.0;
     double d_Vxf2_dV_xf2_GND=0.0;
  double Vxf1=0.0;
     double d_Vxf1_dV_xf1_GND=0.0;
  double Qdeix=0.0;
     double d_Qdeix_dV_xf_GND=0.0;
     double d_Qdeix_dV_tnode_GND=0.0;
     double d_Qdeix_dV_bi_ci=0.0;
     double d_Qdeix_dV_b_ci=0.0;
     double d_Qdeix_dV_bi_ei=0.0;
     double d_Qdeix_dV_ci_ei=0.0;
  double Itxf=0.0;
     double d_Itxf_dV_xf2_GND=0.0;
     double d_Itxf_dV_tnode_GND=0.0;
     double d_Itxf_dV_bi_ei=0.0;
     double d_Itxf_dV_bi_ci=0.0;
     double d_Itxf_dV_b_ci=0.0;
     double d_Itxf_dV_ci_ei=0.0;
  double pterm=0.0;
     double d_pterm_dV_ci_c=0.0;
     double d_pterm_dV_ei_e=0.0;
     double d_pterm_dV_b_bi=0.0;
     double d_pterm_dV_s_ci=0.0;
     double d_pterm_dV_tnode_GND=0.0;
     double d_pterm_dV_bi_ei=0.0;
     double d_pterm_dV_bi_ci=0.0;
     double d_pterm_dV_b_ci=0.0;
     double d_pterm_dV_ci_ei=0.0;
  double qjs=0.0;
     double d_qjs_dV_ci_ei=0.0;
     double d_qjs_dV_bi_ei=0.0;
     double d_qjs_dV_s_ci=0.0;
     double d_qjs_dV_bi_ci=0.0;
     double d_qjs_dV_tnode_GND=0.0;
     double d_qjs_dV_b_ci=0.0;
  double HSI_Tsu=0.0;
     double d_HSI_Tsu_dV_tnode_GND=0.0;
     double d_HSI_Tsu_dV_b_ci=0.0;
     double d_HSI_Tsu_dV_s_ci=0.0;
  double HSb=0.0;
     double d_HSb_dV_s_ci=0.0;
     double d_HSb_dV_tnode_GND=0.0;
  double HSa=0.0;
     double d_HSa_dV_b_ci=0.0;
     double d_HSa_dV_tnode_GND=0.0;
  double HSUM=0.0;
     double d_HSUM_dV_tnode_GND=0.0;
  double rb=0.0;
     double d_rb_dV_tnode_GND=0.0;
     double d_rb_dV_bi_ei=0.0;
     double d_rb_dV_ci_ei=0.0;
     double d_rb_dV_bi_ci=0.0;
     double d_rb_dV_b_ci=0.0;
  double eta=0.0;
     double d_eta_dV_tnode_GND=0.0;
     double d_eta_dV_bi_ei=0.0;
     double d_eta_dV_ci_ei=0.0;
     double d_eta_dV_bi_ci=0.0;
     double d_eta_dV_b_ci=0.0;
  double rbi=0.0;
     double d_rbi_dV_tnode_GND=0.0;
     double d_rbi_dV_bi_ei=0.0;
     double d_rbi_dV_ci_ei=0.0;
     double d_rbi_dV_bi_ci=0.0;
     double d_rbi_dV_b_ci=0.0;
  double fQz=0.0;
     double d_fQz_dV_tnode_GND=0.0;
     double d_fQz_dV_bi_ei=0.0;
     double d_fQz_dV_ci_ei=0.0;
     double d_fQz_dV_bi_ci=0.0;
     double d_fQz_dV_b_ci=0.0;
  double Qz_nom=0.0;
     double d_Qz_nom_dV_tnode_GND=0.0;
     double d_Qz_nom_dV_bi_ei=0.0;
     double d_Qz_nom_dV_ci_ei=0.0;
     double d_Qz_nom_dV_bi_ci=0.0;
     double d_Qz_nom_dV_b_ci=0.0;
  double a_iavl=0.0;
     double d_a_iavl_dV_tnode_GND=0.0;
     double d_a_iavl_dV_bi_ci=0.0;
     double d_a_iavl_dV_b_ci=0.0;
  double lncc=0.0;
     double d_lncc_dV_tnode_GND=0.0;
     double d_lncc_dV_bi_ci=0.0;
     double d_lncc_dV_b_ci=0.0;
  double v_bord=0.0;
     double d_v_bord_dV_tnode_GND=0.0;
  double ibi=0.0;
     double d_ibi_dV_tnode_GND=0.0;
     double d_ibi_dV_bi_ei=0.0;
     double d_ibi_dV_bi_ci=0.0;
  double ire=0.0;
     double d_ire_dV_tnode_GND=0.0;
     double d_ire_dV_bi_ei=0.0;
  double ibe=0.0;
     double d_ibe_dV_tnode_GND=0.0;
     double d_ibe_dV_bi_ei=0.0;
  double le=0.0;
     double d_le_dV_s_ci=0.0;
     double d_le_dV_bi_ci=0.0;
     double d_le_dV_bi_ei=0.0;
     double d_le_dV_tnode_GND=0.0;
  double DIOY=0.0;
     double d_DIOY_dV_s_ci=0.0;
     double d_DIOY_dV_bi_ci=0.0;
     double d_DIOY_dV_bi_ei=0.0;
     double d_DIOY_dV_tnode_GND=0.0;
  double qr=0.0;
     double d_qr_dV_tnode_GND=0.0;
     double d_qr_dV_bi_ci=0.0;
     double d_qr_dV_b_ci=0.0;
     double d_qr_dV_bi_ei=0.0;
     double d_qr_dV_ci_ei=0.0;
  double tf=0.0;
     double d_tf_dV_tnode_GND=0.0;
     double d_tf_dV_bi_ci=0.0;
     double d_tf_dV_b_ci=0.0;
     double d_tf_dV_ci_ei=0.0;
     double d_tf_dV_bi_ei=0.0;
  double qf=0.0;
     double d_qf_dV_tnode_GND=0.0;
     double d_qf_dV_bi_ci=0.0;
     double d_qf_dV_b_ci=0.0;
     double d_qf_dV_bi_ei=0.0;
     double d_qf_dV_ci_ei=0.0;
  double dqef=0.0;
     double d_dqef_dV_tnode_GND=0.0;
     double d_dqef_dV_bi_ei=0.0;
     double d_dqef_dV_bi_ci=0.0;
     double d_dqef_dV_b_ci=0.0;
     double d_dqef_dV_ci_ei=0.0;
  double dtef=0.0;
     double d_dtef_dV_tnode_GND=0.0;
     double d_dtef_dV_bi_ei=0.0;
     double d_dtef_dV_bi_ci=0.0;
     double d_dtef_dV_b_ci=0.0;
     double d_dtef_dV_ci_ei=0.0;
  double dtfh=0.0;
     double d_dtfh_dV_tnode_GND=0.0;
     double d_dtfh_dV_ci_ei=0.0;
     double d_dtfh_dV_bi_ei=0.0;
     double d_dtfh_dV_bi_ci=0.0;
     double d_dtfh_dV_b_ci=0.0;
  double dqfh=0.0;
     double d_dqfh_dV_tnode_GND=0.0;
     double d_dqfh_dV_ci_ei=0.0;
     double d_dqfh_dV_bi_ei=0.0;
     double d_dqfh_dV_bi_ci=0.0;
     double d_dqfh_dV_b_ci=0.0;
  double tww=0.0;
     double d_tww_dV_tnode_GND=0.0;
     double d_tww_dV_ci_ei=0.0;
     double d_tww_dV_bi_ei=0.0;
     double d_tww_dV_bi_ci=0.0;
     double d_tww_dV_b_ci=0.0;
  double w=0.0;
     double d_w_dV_ci_ei=0.0;
     double d_w_dV_bi_ei=0.0;
     double d_w_dV_bi_ci=0.0;
     double d_w_dV_b_ci=0.0;
     double d_w_dV_tnode_GND=0.0;
  double s3=0.0;
     double d_s3_dV_ci_ei=0.0;
     double d_s3_dV_bi_ei=0.0;
     double d_s3_dV_bi_ci=0.0;
     double d_s3_dV_b_ci=0.0;
     double d_s3_dV_tnode_GND=0.0;
  double qf0=0.0;
     double d_qf0_dV_tnode_GND=0.0;
     double d_qf0_dV_bi_ci=0.0;
     double d_qf0_dV_b_ci=0.0;
     double d_qf0_dV_bi_ei=0.0;
     double d_qf0_dV_ci_ei=0.0;
  double itr=0.0;
     double d_itr_dV_tnode_GND=0.0;
     double d_itr_dV_bi_ci=0.0;
     double d_itr_dV_b_ci=0.0;
     double d_itr_dV_bi_ei=0.0;
     double d_itr_dV_ci_ei=0.0;
  double itf=0.0;
     double d_itf_dV_tnode_GND=0.0;
     double d_itf_dV_bi_ei=0.0;
     double d_itf_dV_bi_ci=0.0;
     double d_itf_dV_b_ci=0.0;
     double d_itf_dV_ci_ei=0.0;
  double qpt=0.0;
     double d_qpt_dV_bi_ci=0.0;
     double d_qpt_dV_tnode_GND=0.0;
     double d_qpt_dV_b_ci=0.0;
     double d_qpt_dV_bi_ei=0.0;
     double d_qpt_dV_ci_ei=0.0;
  double qm=0.0;
     double d_qm_dV_tnode_GND=0.0;
     double d_qm_dV_bi_ei=0.0;
     double d_qm_dV_bi_ci=0.0;
     double d_qm_dV_b_ci=0.0;
     double d_qm_dV_ci_ei=0.0;
  double q_p3=0.0;
     double d_q_p3_dV_bi_ci=0.0;
     double d_q_p3_dV_tnode_GND=0.0;
     double d_q_p3_dV_b_ci=0.0;
     double d_q_p3_dV_bi_ei=0.0;
     double d_q_p3_dV_ci_ei=0.0;
  double tmp2=0.0;
     double d_tmp2_dV_bi_ci=0.0;
     double d_tmp2_dV_tnode_GND=0.0;
     double d_tmp2_dV_b_ci=0.0;
     double d_tmp2_dV_bi_ei=0.0;
     double d_tmp2_dV_ci_ei=0.0;
  double tmp3=0.0;
     double d_tmp3_dV_bi_ci=0.0;
     double d_tmp3_dV_tnode_GND=0.0;
     double d_tmp3_dV_b_ci=0.0;
     double d_tmp3_dV_bi_ei=0.0;
     double d_tmp3_dV_ci_ei=0.0;
  double p2_u=0.0;
     double d_p2_u_dV_bi_ci=0.0;
     double d_p2_u_dV_tnode_GND=0.0;
     double d_p2_u_dV_b_ci=0.0;
     double d_p2_u_dV_bi_ei=0.0;
     double d_p2_u_dV_ci_ei=0.0;
  double p2_v=0.0;
     double d_p2_v_dV_bi_ci=0.0;
     double d_p2_v_dV_tnode_GND=0.0;
     double d_p2_v_dV_b_ci=0.0;
     double d_p2_v_dV_bi_ei=0.0;
     double d_p2_v_dV_ci_ei=0.0;
  double p2_D=0.0;
     double d_p2_D_dV_bi_ci=0.0;
     double d_p2_D_dV_tnode_GND=0.0;
     double d_p2_D_dV_b_ci=0.0;
     double d_p2_D_dV_bi_ei=0.0;
     double d_p2_D_dV_ci_ei=0.0;
  double p2_q=0.0;
     double d_p2_q_dV_bi_ci=0.0;
     double d_p2_q_dV_tnode_GND=0.0;
     double d_p2_q_dV_b_ci=0.0;
     double d_p2_q_dV_bi_ei=0.0;
     double d_p2_q_dV_ci_ei=0.0;
  double p2_p=0.0;
     double d_p2_p_dV_tnode_GND=0.0;
     double d_p2_p_dV_bi_ei=0.0;
     double d_p2_p_dV_bi_ci=0.0;
     double d_p2_p_dV_b_ci=0.0;
     double d_p2_p_dV_ci_ei=0.0;
  double tmp=0.0;
     double d_tmp_dV_bi_ci=0.0;
     double d_tmp_dV_tnode_GND=0.0;
     double d_tmp_dV_b_ci=0.0;
     double d_tmp_dV_bi_ei=0.0;
     double d_tmp_dV_ci_ei=0.0;
  double p2_c=0.0;
     double d_p2_c_dV_tnode_GND=0.0;
     double d_p2_c_dV_bi_ei=0.0;
     double d_p2_c_dV_ci_ei=0.0;
  double p2_b=0.0;
     double d_p2_b_dV_tnode_GND=0.0;
     double d_p2_b_dV_bi_ei=0.0;
     double d_p2_b_dV_bi_ci=0.0;
     double d_p2_b_dV_b_ci=0.0;
     double d_p2_b_dV_ci_ei=0.0;
  double p2_a=0.0;
     double d_p2_a_dV_bi_ci=0.0;
     double d_p2_a_dV_tnode_GND=0.0;
     double d_p2_a_dV_b_ci=0.0;
     double d_p2_a_dV_bi_ei=0.0;
     double d_p2_a_dV_ci_ei=0.0;
  double o3=0.0;
  double wdc=0.0;
     double d_wdc_dV_tnode_GND=0.0;
     double d_wdc_dV_ci_ei=0.0;
     double d_wdc_dV_bi_ei=0.0;
     double d_wdc_dV_bi_ci=0.0;
     double d_wdc_dV_b_ci=0.0;
  double aa=0.0;
     double d_aa_dV_tnode_GND=0.0;
     double d_aa_dV_ci_ei=0.0;
     double d_aa_dV_bi_ei=0.0;
     double d_aa_dV_bi_ci=0.0;
     double d_aa_dV_b_ci=0.0;
  double a2=0.0;
     double d_a2_dV_tnode_GND=0.0;
     double d_a2_dV_ci_ei=0.0;
     double d_a2_dV_bi_ei=0.0;
     double d_a2_dV_bi_ci=0.0;
     double d_a2_dV_b_ci=0.0;
  double a1=0.0;
     double d_a1_dV_tnode_GND=0.0;
     double d_a1_dV_ci_ei=0.0;
     double d_a1_dV_bi_ei=0.0;
     double d_a1_dV_bi_ci=0.0;
     double d_a1_dV_b_ci=0.0;
  double diff_q=0.0;
     double d_diff_q_dV_tnode_GND=0.0;
     double d_diff_q_dV_bi_ei=0.0;
     double d_diff_q_dV_bi_ci=0.0;
     double d_diff_q_dV_b_ci=0.0;
     double d_diff_q_dV_ci_ei=0.0;
  double qpt_h=0.0;
     double d_qpt_h_dV_bi_ci=0.0;
     double d_qpt_h_dV_tnode_GND=0.0;
     double d_qpt_h_dV_b_ci=0.0;
     double d_qpt_h_dV_bi_ei=0.0;
     double d_qpt_h_dV_ci_ei=0.0;
  double qpt_l=0.0;
     double d_qpt_l_dV_bi_ci=0.0;
     double d_qpt_l_dV_tnode_GND=0.0;
     double d_qpt_l_dV_b_ci=0.0;
     double d_qpt_l_dV_bi_ei=0.0;
     double d_qpt_l_dV_ci_ei=0.0;
  double qmh=0.0;
     double d_qmh_dV_tnode_GND=0.0;
     double d_qmh_dV_bi_ei=0.0;
     double d_qmh_dV_bi_ci=0.0;
     double d_qmh_dV_b_ci=0.0;
     double d_qmh_dV_ci_ei=0.0;
  double qml=0.0;
     double d_qml_dV_tnode_GND=0.0;
     double d_qml_dV_bi_ei=0.0;
     double d_qml_dV_bi_ci=0.0;
     double d_qml_dV_b_ci=0.0;
     double d_qml_dV_ci_ei=0.0;
  double itri=0.0;
     double d_itri_dV_tnode_GND=0.0;
     double d_itri_dV_bi_ci=0.0;
  double le2=0.0;
     double d_le2_dV_bi_ci=0.0;
     double d_le2_dV_tnode_GND=0.0;
  double arg2=0.0;
     double d_arg2_dV_bi_ci=0.0;
     double d_arg2_dV_tnode_GND=0.0;
  double itfi=0.0;
     double d_itfi_dV_tnode_GND=0.0;
     double d_itfi_dV_bi_ei=0.0;
  double le1=0.0;
     double d_le1_dV_bi_ei=0.0;
     double d_le1_dV_tnode_GND=0.0;
  double arg1=0.0;
     double d_arg1_dV_bi_ei=0.0;
     double d_arg1_dV_tnode_GND=0.0;
  double ickr=0.0;
  double ickf=0.0;
     double d_ickf_dV_tnode_GND=0.0;
     double d_ickf_dV_bi_ci=0.0;
     double d_ickf_dV_b_ci=0.0;
  double denom_iqf=0.0;
     double d_denom_iqf_dV_tnode_GND=0.0;
     double d_denom_iqf_dV_bi_ci=0.0;
     double d_denom_iqf_dV_b_ci=0.0;
  double tf0=0.0;
     double d_tf0_dV_tnode_GND=0.0;
     double d_tf0_dV_bi_ci=0.0;
     double d_tf0_dV_b_ci=0.0;
  double qj_2=0.0;
     double d_qj_2_dV_bi_ci=0.0;
     double d_qj_2_dV_tnode_GND=0.0;
     double d_qj_2_dV_b_ci=0.0;
     double d_qj_2_dV_bi_ei=0.0;
     double d_qj_2_dV_ci_ei=0.0;
  double b_q=0.0;
     double d_b_q_dV_bi_ci=0.0;
     double d_b_q_dV_tnode_GND=0.0;
     double d_b_q_dV_b_ci=0.0;
     double d_b_q_dV_bi_ei=0.0;
     double d_b_q_dV_ci_ei=0.0;
  double qj=0.0;
     double d_qj_dV_bi_ci=0.0;
     double d_qj_dV_tnode_GND=0.0;
     double d_qj_dV_b_ci=0.0;
     double d_qj_dV_bi_ei=0.0;
     double d_qj_dV_ci_ei=0.0;
  double qje=0.0;
     double d_qje_dV_tnode_GND=0.0;
     double d_qje_dV_bi_ei=0.0;
     double d_qje_dV_ci_ei=0.0;
     double d_qje_dV_bi_ci=0.0;
     double d_qje_dV_b_ci=0.0;
  double h_vbe=0.0;
     double d_h_vbe_dV_tnode_GND=0.0;
     double d_h_vbe_dV_bi_ei=0.0;
  double vj_z=0.0;
     double d_vj_z_dV_tnode_GND=0.0;
     double d_vj_z_dV_bi_ei=0.0;
  double vjh=0.0;
     double d_vjh_dV_tnode_GND=0.0;
     double d_vjh_dV_bi_ei=0.0;
  double cc=0.0;
     double d_cc_dV_tnode_GND=0.0;
     double d_cc_dV_bi_ci=0.0;
     double d_cc_dV_b_ci=0.0;
  double ick=0.0;
     double d_ick_dV_tnode_GND=0.0;
     double d_ick_dV_ci_ei=0.0;
  double vceff=0.0;
     double d_vceff_dV_tnode_GND=0.0;
     double d_vceff_dV_ci_ei=0.0;
  double uvc=0.0;
     double d_uvc_dV_ci_ei=0.0;
     double d_uvc_dV_tnode_GND=0.0;
  double vc=0.0;
     double d_vc_dV_ci_ei=0.0;
     double d_vc_dV_tnode_GND=0.0;
  double cjcii=0.0;
     double d_cjcii_dV_tnode_GND=0.0;
     double d_cjcii_dV_bi_ci=0.0;
     double d_cjcii_dV_b_ci=0.0;
  double dvj=0.0;
     double d_dvj_dV_bi_ci=0.0;
     double d_dvj_dV_tnode_GND=0.0;
     double d_dvj_dV_b_ci=0.0;
  double qjcii=0.0;
     double d_qjcii_dV_bi_ci=0.0;
     double d_qjcii_dV_tnode_GND=0.0;
     double d_qjcii_dV_b_ci=0.0;
  double qjci_int=0.0;
     double d_qjci_int_dV_bi_ci=0.0;
     double d_qjci_int_dV_tnode_GND=0.0;
     double d_qjci_int_dV_b_ci=0.0;
  double qjcx=0.0;
     double d_qjcx_dV_bi_ci=0.0;
     double d_qjcx_dV_tnode_GND=0.0;
     double d_qjcx_dV_b_ci=0.0;
  double qj3=0.0;
     double d_qj3_dV_ci_ei=0.0;
     double d_qj3_dV_bi_ei=0.0;
     double d_qj3_dV_s_ci=0.0;
     double d_qj3_dV_bi_ci=0.0;
     double d_qj3_dV_tnode_GND=0.0;
     double d_qj3_dV_b_ci=0.0;
  double qj2=0.0;
     double d_qj2_dV_ci_ei=0.0;
     double d_qj2_dV_bi_ei=0.0;
     double d_qj2_dV_s_ci=0.0;
     double d_qj2_dV_bi_ci=0.0;
     double d_qj2_dV_tnode_GND=0.0;
     double d_qj2_dV_b_ci=0.0;
  double qj1=0.0;
     double d_qj1_dV_ci_ei=0.0;
     double d_qj1_dV_bi_ei=0.0;
     double d_qj1_dV_s_ci=0.0;
     double d_qj1_dV_bi_ci=0.0;
     double d_qj1_dV_tnode_GND=0.0;
     double d_qj1_dV_b_ci=0.0;
  double vdj2=0.0;
     double d_vdj2_dV_ci_ei=0.0;
     double d_vdj2_dV_bi_ei=0.0;
     double d_vdj2_dV_s_ci=0.0;
     double d_vdj2_dV_bi_ci=0.0;
     double d_vdj2_dV_tnode_GND=0.0;
     double d_vdj2_dV_b_ci=0.0;
  double vdj1=0.0;
     double d_vdj1_dV_ci_ei=0.0;
     double d_vdj1_dV_bi_ei=0.0;
     double d_vdj1_dV_s_ci=0.0;
     double d_vdj1_dV_bi_ci=0.0;
     double d_vdj1_dV_tnode_GND=0.0;
     double d_vdj1_dV_b_ci=0.0;
  double ezr=0.0;
  double ez=0.0;
  double vj4=0.0;
     double d_vj4_dV_s_ci=0.0;
     double d_vj4_dV_ci_ei=0.0;
     double d_vj4_dV_bi_ei=0.0;
     double d_vj4_dV_bi_ci=0.0;
     double d_vj4_dV_b_ci=0.0;
     double d_vj4_dV_tnode_GND=0.0;
  double vj2=0.0;
     double d_vj2_dV_ci_ei=0.0;
     double d_vj2_dV_bi_ei=0.0;
     double d_vj2_dV_s_ci=0.0;
     double d_vj2_dV_bi_ci=0.0;
     double d_vj2_dV_tnode_GND=0.0;
     double d_vj2_dV_b_ci=0.0;
  double vr=0.0;
     double d_vr_dV_ci_ei=0.0;
     double d_vr_dV_bi_ei=0.0;
     double d_vr_dV_s_ci=0.0;
     double d_vr_dV_bi_ci=0.0;
     double d_vr_dV_tnode_GND=0.0;
     double d_vr_dV_b_ci=0.0;
  double vj1=0.0;
     double d_vj1_dV_ci_ei=0.0;
     double d_vj1_dV_bi_ei=0.0;
     double d_vj1_dV_s_ci=0.0;
     double d_vj1_dV_bi_ci=0.0;
     double d_vj1_dV_tnode_GND=0.0;
     double d_vj1_dV_b_ci=0.0;
  double ee1=0.0;
     double d_ee1_dV_s_ci=0.0;
     double d_ee1_dV_ci_ei=0.0;
     double d_ee1_dV_bi_ei=0.0;
     double d_ee1_dV_bi_ci=0.0;
     double d_ee1_dV_tnode_GND=0.0;
     double d_ee1_dV_b_ci=0.0;
  double ex1=0.0;
     double d_ex1_dV_s_ci=0.0;
     double d_ex1_dV_ci_ei=0.0;
     double d_ex1_dV_bi_ei=0.0;
     double d_ex1_dV_bi_ci=0.0;
     double d_ex1_dV_tnode_GND=0.0;
     double d_ex1_dV_b_ci=0.0;
  double ve=0.0;
     double d_ve_dV_s_ci=0.0;
     double d_ve_dV_ci_ei=0.0;
     double d_ve_dV_bi_ei=0.0;
     double d_ve_dV_bi_ci=0.0;
     double d_ve_dV_tnode_GND=0.0;
     double d_ve_dV_b_ci=0.0;
  double a=0.0;
     double d_a_dV_ci_ei=0.0;
     double d_a_dV_bi_ei=0.0;
     double d_a_dV_bi_ci=0.0;
     double d_a_dV_b_ci=0.0;
     double d_a_dV_tnode_GND=0.0;
  double cr=0.0;
     double d_cr_dV_tnode_GND=0.0;
  double cmax=0.0;
     double d_cmax_dV_tnode_GND=0.0;
  double vf=0.0;
     double d_vf_dV_tnode_GND=0.0;
  double vp=0.0;
     double d_vp_dV_tnode_GND=0.0;
  double zr=0.0;
  double y=0.0;
     double d_y_dV_s_ci=0.0;
     double d_y_dV_ci_ei=0.0;
     double d_y_dV_bi_ei=0.0;
     double d_y_dV_bi_ci=0.0;
     double d_y_dV_tnode_GND=0.0;
     double d_y_dV_b_ci=0.0;
  double x=0.0;
     double d_x_dV_tnode_GND=0.0;
     double d_x_dV_ci_ei=0.0;
  double v_j=0.0;
     double d_v_j_dV_s_ci=0.0;
     double d_v_j_dV_bi_ei=0.0;
     double d_v_j_dV_bi_ci=0.0;
     double d_v_j_dV_tnode_GND=0.0;
     double d_v_j_dV_b_ci=0.0;
  double xvf2=0.0;
     double d_xvf2_dV_s_ci=0.0;
     double d_xvf2_dV_bi_ei=0.0;
     double d_xvf2_dV_bi_ci=0.0;
     double d_xvf2_dV_tnode_GND=0.0;
     double d_xvf2_dV_b_ci=0.0;
  double xvf=0.0;
     double d_xvf_dV_s_ci=0.0;
     double d_xvf_dV_bi_ei=0.0;
     double d_xvf_dV_bi_ci=0.0;
     double d_xvf_dV_tnode_GND=0.0;
     double d_xvf_dV_b_ci=0.0;
  double cjcx0_t_i=0.0;
     double d_cjcx0_t_i_dV_tnode_GND=0.0;
  double qjcxi=0.0;
     double d_qjcxi_dV_bi_ci=0.0;
     double d_qjcxi_dV_tnode_GND=0.0;
     double d_qjcxi_dV_b_ci=0.0;
  double cjci0_t_ii=0.0;
     double d_cjci0_t_ii_dV_tnode_GND=0.0;
  double cjcx0_t_ii=0.0;
     double d_cjcx0_t_ii_dV_tnode_GND=0.0;
  double ahq_t=0.0;
  double tfh_t=0.0;
     double d_tfh_t_dV_tnode_GND=0.0;
  double iqfh_t=0.0;
     double d_iqfh_t_dV_tnode_GND=0.0;
  double ver_t=0.0;
     double d_ver_t_dV_tnode_GND=0.0;
  double aver_t=0.0;
     double d_aver_t_dV_tnode_GND=0.0;
  double rth_t=0.0;
  double kavl_t=0.0;
     double d_kavl_t_dV_tnode_GND=0.0;
  double eavl_t=0.0;
     double d_eavl_t_dV_tnode_GND=0.0;
  double re_t=0.0;
     double d_re_t_dV_tnode_GND=0.0;
  double rbi0_t=0.0;
     double d_rbi0_t_dV_tnode_GND=0.0;
  double rcx_t=0.0;
     double d_rcx_t_dV_tnode_GND=0.0;
  double rbx_t=0.0;
     double d_rbx_t_dV_tnode_GND=0.0;
  double tef0_t=0.0;
     double d_tef0_t_dV_tnode_GND=0.0;
  double dvg=0.0;
  double zetatef=0.0;
  double thcs_t=0.0;
     double d_thcs_t_dV_tnode_GND=0.0;
  double t0_t=0.0;
     double d_t0_t_dV_tnode_GND=0.0;
  double vces_t=0.0;
     double d_vces_t_dV_tnode_GND=0.0;
  double vlim_t=0.0;
     double d_vlim_t_dV_tnode_GND=0.0;
  double rci0_t=0.0;
     double d_rci0_t_dV_tnode_GND=0.0;
  double iqf_t=0.0;
     double d_iqf_t_dV_tnode_GND=0.0;
  double cjs0_t=0.0;
     double d_cjs0_t_dV_tnode_GND=0.0;
  double vds_t=0.0;
     double d_vds_t_dV_tnode_GND=0.0;
  double cjcx0_t=0.0;
     double d_cjcx0_t_dV_tnode_GND=0.0;
  double vdcx_t=0.0;
     double d_vdcx_t_dV_tnode_GND=0.0;
  double cjci0_t=0.0;
     double d_cjci0_t_dV_tnode_GND=0.0;
  double vdci_t=0.0;
     double d_vdci_t_dV_tnode_GND=0.0;
  double ajedc_t=0.0;
     double d_ajedc_t_dV_tnode_GND=0.0;
  double aje_t=0.0;
     double d_aje_t_dV_tnode_GND=0.0;
  double cje0_dc_t=0.0;
     double d_cje0_dc_t_dV_tnode_GND=0.0;
  double vdedc_t=0.0;
     double d_vdedc_t_dV_tnode_GND=0.0;
  double cje0_dc=0.0;
  double cje0_t=0.0;
     double d_cje0_t_dV_tnode_GND=0.0;
  double vde_t=0.0;
     double d_vde_t_dV_tnode_GND=0.0;
  double vdjt=0.0;
     double d_vdjt_dV_tnode_GND=0.0;
  double vdj0=0.0;
  double arg=0.0;
  double iscs_t=0.0;
     double d_iscs_t_dV_tnode_GND=0.0;
  double itss_t=0.0;
     double d_itss_t_dV_tnode_GND=0.0;
  double ibcs_t=0.0;
     double d_ibcs_t_dV_tnode_GND=0.0;
  double ires_t=0.0;
     double d_ires_t_dV_tnode_GND=0.0;
  double ibes_t=0.0;
     double d_ibes_t_dV_tnode_GND=0.0;
  double is_t=0.0;
     double d_is_t_dV_tnode_GND=0.0;
  double zetasct=0.0;
  double zetabci=0.0;
  double mg=0.0;
  double vgsc=0.0;
  double vgbc=0.0;
  double vgbe=0.0;
  double avs=0.0;
  double ln_qtt0=0.0;
     double d_ln_qtt0_dV_tnode_GND=0.0;
  double qtt0=0.0;
     double d_qtt0_dV_tnode_GND=0.0;
  double dT=0.0;
     double d_dT_dV_tnode_GND=0.0;
  double VT=0.0;
     double d_VT_dV_tnode_GND=0.0;
  double vt0=0.0;
  double Tdev=0.0;
     double d_Tdev_dV_tnode_GND=0.0;
  double Tamb=0.0;
  double Tnom=0.0;
  double Vrth=0.0;
     double d_Vrth_dV_tnode_GND=0.0;
  double Vbe=0.0;
     double d_Vbe_dV_b_e=0.0;
  double Vbbi=0.0;
     double d_Vbbi_dV_b_bi=0.0;
  double Vcic=0.0;
     double d_Vcic_dV_ci_c=0.0;
  double Veie=0.0;
     double d_Veie_dV_ei_e=0.0;
  double Vsci=0.0;
     double d_Vsci_dV_s_ci=0.0;
  double Vciei=0.0;
     double d_Vciei_dV_ci_ei=0.0;
  double Vbiei=0.0;
     double d_Vbiei_dV_bi_ei=0.0;
  double Vbici=0.0;
     double d_Vbici_dV_bi_ci=0.0;
  double Vbci=0.0;
     double d_Vbci_dV_b_ci=0.0;
  double HICUMtype=0.0;


  // set the sizes of the Fad arrays:

  if (probeVars.size() != (20))
  {
    probeVars.resize(20);
    d_probeVars.resize(20);
    for (int i=0;i<20;i++)
    {
      d_probeVars[i].resize(20);
      for (int j=0;j<20;j++)
        d_probeVars[i][j]=0.0;
    }
    staticContributions.resize(11+0);
    d_staticContributions.resize(11+0);
    for (int i=0;i<11+0;i++)
      d_staticContributions[i].resize(20);
    dynamicContributions.resize(11+0);
    d_dynamicContributions.resize(11+0);
    for (int i=0;i<11+0;i++)
      d_dynamicContributions[i].resize(20);
  }

    noiseContribsPower.resize(6);
    noiseContribsExponent.resize(6);

  // initialize contributions to zero (automatically sets derivatives to zero)
  for (int i=0; i < 11+0 ; ++i)
  {
     staticContributions[i]=0;
     for (int j=0;j<20;j++)
        d_staticContributions[i][j] = 0.0;
     dynamicContributions[i]=0;
     for (int j=0;j<20;j++)
        d_dynamicContributions[i][j] = 0.0;
  }

  // extract solution variables and set as Fad independent variables.
probeVars[admsProbeID_V_s_GND] = (*solVectorPtr)[li_s];
d_probeVars[admsProbeID_V_s_GND][admsProbeID_V_s_GND] = 1.0;
probeVars[admsProbeID_V_ei_GND] = (*solVectorPtr)[li_ei];
d_probeVars[admsProbeID_V_ei_GND][admsProbeID_V_ei_GND] = 1.0;
probeVars[admsProbeID_V_ci_GND] = (*solVectorPtr)[li_ci];
d_probeVars[admsProbeID_V_ci_GND][admsProbeID_V_ci_GND] = 1.0;
probeVars[admsProbeID_V_bi_GND] = (*solVectorPtr)[li_bi];
d_probeVars[admsProbeID_V_bi_GND][admsProbeID_V_bi_GND] = 1.0;
probeVars[admsProbeID_V_s_c] = (*solVectorPtr)[li_s] - (*solVectorPtr)[li_c];
d_probeVars[admsProbeID_V_s_c][admsProbeID_V_s_c] = 1.0;
probeVars[admsProbeID_V_c_e] = (*solVectorPtr)[li_c] - (*solVectorPtr)[li_e];
d_probeVars[admsProbeID_V_c_e][admsProbeID_V_c_e] = 1.0;
probeVars[admsProbeID_V_b_c] = (*solVectorPtr)[li_b] - (*solVectorPtr)[li_c];
d_probeVars[admsProbeID_V_b_c][admsProbeID_V_b_c] = 1.0;
probeVars[admsProbeID_V_xf_GND] = (*solVectorPtr)[li_xf];
d_probeVars[admsProbeID_V_xf_GND][admsProbeID_V_xf_GND] = 1.0;
probeVars[admsProbeID_V_xf2_GND] = (*solVectorPtr)[li_xf2];
d_probeVars[admsProbeID_V_xf2_GND][admsProbeID_V_xf2_GND] = 1.0;
probeVars[admsProbeID_V_xf1_GND] = (*solVectorPtr)[li_xf1];
d_probeVars[admsProbeID_V_xf1_GND][admsProbeID_V_xf1_GND] = 1.0;
probeVars[admsProbeID_V_tnode_GND] = (*solVectorPtr)[li_tnode];
d_probeVars[admsProbeID_V_tnode_GND][admsProbeID_V_tnode_GND] = 1.0;
probeVars[admsProbeID_V_b_e] = (*solVectorPtr)[li_b] - (*solVectorPtr)[li_e];
d_probeVars[admsProbeID_V_b_e][admsProbeID_V_b_e] = 1.0;
probeVars[admsProbeID_V_b_bi] = (*solVectorPtr)[li_b] - (*solVectorPtr)[li_bi];
d_probeVars[admsProbeID_V_b_bi][admsProbeID_V_b_bi] = 1.0;
probeVars[admsProbeID_V_ci_c] = (*solVectorPtr)[li_ci] - (*solVectorPtr)[li_c];
d_probeVars[admsProbeID_V_ci_c][admsProbeID_V_ci_c] = 1.0;
probeVars[admsProbeID_V_ei_e] = (*solVectorPtr)[li_ei] - (*solVectorPtr)[li_e];
d_probeVars[admsProbeID_V_ei_e][admsProbeID_V_ei_e] = 1.0;
probeVars[admsProbeID_V_s_ci] = (*solVectorPtr)[li_s] - (*solVectorPtr)[li_ci];
d_probeVars[admsProbeID_V_s_ci][admsProbeID_V_s_ci] = 1.0;
probeVars[admsProbeID_V_ci_ei] = (*solVectorPtr)[li_ci] - (*solVectorPtr)[li_ei];
d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei] = 1.0;
probeVars[admsProbeID_V_bi_ei] = (*solVectorPtr)[li_bi] - (*solVectorPtr)[li_ei];
d_probeVars[admsProbeID_V_bi_ei][admsProbeID_V_bi_ei] = 1.0;
probeVars[admsProbeID_V_bi_ci] = (*solVectorPtr)[li_bi] - (*solVectorPtr)[li_ci];
d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci] = 1.0;
probeVars[admsProbeID_V_b_ci] = (*solVectorPtr)[li_b] - (*solVectorPtr)[li_ci];
d_probeVars[admsProbeID_V_b_ci][admsProbeID_V_b_ci] = 1.0;
// -- code converted from analog/code block
HICUMtype = (model_.type);

d_Vbci_dV_b_ci = HICUMtype*d_probeVars[admsProbeID_V_b_ci][admsProbeID_V_b_ci];
Vbci = (HICUMtype*(probeVars[admsProbeID_V_b_ci]));

d_Vbici_dV_bi_ci = HICUMtype*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
Vbici = (HICUMtype*(probeVars[admsProbeID_V_bi_ci]));

d_Vbiei_dV_bi_ei = HICUMtype*d_probeVars[admsProbeID_V_bi_ei][admsProbeID_V_bi_ei];
Vbiei = (HICUMtype*(probeVars[admsProbeID_V_bi_ei]));

d_Vciei_dV_ci_ei = HICUMtype*d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei];
Vciei = (HICUMtype*(probeVars[admsProbeID_V_ci_ei]));

d_Vsci_dV_s_ci = HICUMtype*d_probeVars[admsProbeID_V_s_ci][admsProbeID_V_s_ci];
Vsci = (HICUMtype*(probeVars[admsProbeID_V_s_ci]));

d_Veie_dV_ei_e = d_probeVars[admsProbeID_V_ei_e][admsProbeID_V_ei_e];
Veie = (probeVars[admsProbeID_V_ei_e]);

d_Vcic_dV_ci_c = d_probeVars[admsProbeID_V_ci_c][admsProbeID_V_ci_c];
Vcic = (probeVars[admsProbeID_V_ci_c]);

d_Vbbi_dV_b_bi = d_probeVars[admsProbeID_V_b_bi][admsProbeID_V_b_bi];
Vbbi = (probeVars[admsProbeID_V_b_bi]);

d_Vbe_dV_b_e = HICUMtype*d_probeVars[admsProbeID_V_b_e][admsProbeID_V_b_e];
Vbe = (HICUMtype*(probeVars[admsProbeID_V_b_e]));

d_Vrth_dV_tnode_GND = d_probeVars[admsProbeID_V_tnode_GND][admsProbeID_V_tnode_GND];
Vrth = (probeVars[admsProbeID_V_tnode_GND]);
Tnom = ((model_.tnom)+273.15);
Tamb = admsTemperature;

d_Tdev_dV_tnode_GND = d_Vrth_dV_tnode_GND;
Tdev = ((Tamb+dt)+Vrth);
if ((Tdev<((-100.00)+273.15)))
{

d_Tdev_dV_tnode_GND =  0.0;
Tdev = ((-100.00)+273.15);
}
else
{
if ((Tdev>(326.85+273.15)))
{

d_Tdev_dV_tnode_GND =  0.0;
Tdev = (326.85+273.15);
}
}
vt0 = ((1.3806503e-23*Tnom)/1.6021766208e-19);

d_VT_dV_tnode_GND = (1.3806503e-23*d_Tdev_dV_tnode_GND/1.6021766208e-19);
VT = ((1.3806503e-23*Tdev)/1.6021766208e-19);

d_dT_dV_tnode_GND = d_Tdev_dV_tnode_GND;
dT = (Tdev-Tnom);

d_qtt0_dV_tnode_GND = (d_Tdev_dV_tnode_GND/Tnom);
qtt0 = (Tdev/Tnom);
{
double value_log_0 = log(qtt0);
double  deriv_log_0_d0 = (1.0/qtt0);

d_ln_qtt0_dV_tnode_GND = (deriv_log_0_d0*(d_qtt0_dV_tnode_GND));
ln_qtt0 = value_log_0;
}
avs = ((model_.alvs)*Tnom);
vgbe = (((model_.vgb)+(model_.vge))/2);
vgbc = (((model_.vgb)+(model_.vgc))/2);
vgsc = (((model_.vgs)+(model_.vgc))/2);
mg = (3-((1.6021766208e-19*(model_.f1vg))/1.3806503e-23));
zetabci = ((mg+1)-(model_.zetaci));
zetasct = (mg-1.5);
{
double value_exp_0 = exp((((model_.zetact)*ln_qtt0)+(((model_.vgb)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_is_t_dV_tnode_GND = (model_.is)*(deriv_exp_0_d0*(((model_.zetact)*d_ln_qtt0_dV_tnode_GND+(((model_.vgb)/VT)*d_qtt0_dV_tnode_GND+(-(model_.vgb)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
is_t = ((model_.is)*value_exp_0);
}
{
double value_exp_0 = exp((((model_.zetabet)*ln_qtt0)+(((model_.vge)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_ibes_t_dV_tnode_GND = (model_.ibes)*(deriv_exp_0_d0*(((model_.zetabet)*d_ln_qtt0_dV_tnode_GND+(((model_.vge)/VT)*d_qtt0_dV_tnode_GND+(-(model_.vge)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
ibes_t = ((model_.ibes)*value_exp_0);
}
{
double value_exp_0 = exp((((0.5*mg)*ln_qtt0)+(((0.5*vgbe)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_ires_t_dV_tnode_GND = (model_.ires)*(deriv_exp_0_d0*(((0.5*mg)*d_ln_qtt0_dV_tnode_GND+(((0.5*vgbe)/VT)*d_qtt0_dV_tnode_GND+(-(0.5*vgbe)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
ires_t = ((model_.ires)*value_exp_0);
}
{
double value_exp_0 = exp(((zetabci*ln_qtt0)+(((model_.vgc)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_ibcs_t_dV_tnode_GND = (model_.ibcs)*(deriv_exp_0_d0*((zetabci*d_ln_qtt0_dV_tnode_GND+(((model_.vgc)/VT)*d_qtt0_dV_tnode_GND+(-(model_.vgc)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
ibcs_t = ((model_.ibcs)*value_exp_0);
}
{
double value_exp_0 = exp(((zetasct*ln_qtt0)+(((model_.vgc)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_itss_t_dV_tnode_GND = (model_.itss)*(deriv_exp_0_d0*((zetasct*d_ln_qtt0_dV_tnode_GND+(((model_.vgc)/VT)*d_qtt0_dV_tnode_GND+(-(model_.vgc)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
itss_t = ((model_.itss)*value_exp_0);
}
{
double value_exp_0 = exp(((zetasct*ln_qtt0)+(((model_.vgs)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_iscs_t_dV_tnode_GND = (model_.iscs)*(deriv_exp_0_d0*((zetasct*d_ln_qtt0_dV_tnode_GND+(((model_.vgs)/VT)*d_qtt0_dV_tnode_GND+(-(model_.vgs)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
iscs_t = ((model_.iscs)*value_exp_0);
}
arg = ((0.5*(model_.vde))/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
vdj0 = ((2*vt0)*value_log_2);
}

d_vdjt_dV_tnode_GND = ((vdj0*d_qtt0_dV_tnode_GND+vgbe*(-d_qtt0_dV_tnode_GND))-((mg*VT)*d_ln_qtt0_dV_tnode_GND+mg*d_VT_dV_tnode_GND*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbe*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));

d_vde_t_dV_tnode_GND = (d_vdjt_dV_tnode_GND+((2*VT)*(deriv_log_2_d0*(0.5*(deriv_sqrt_1_d0*(4*(deriv_exp_0_d0*(((VT*(-d_vdjt_dV_tnode_GND)-(-vdjt)*d_VT_dV_tnode_GND)/VT/VT)))))))+2*d_VT_dV_tnode_GND*value_log_2));
vde_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log(((model_.vde)/vde_t));
double value_exp_1 = exp(((model_.ze)*value_log_0));
double  deriv_log_0_d0 = (1.0/((model_.vde)/vde_t));
double  deriv_exp_1_d0 = value_exp_1;

d_cje0_t_dV_tnode_GND = (model_.cje0)*(deriv_exp_1_d0*((model_.ze)*(deriv_log_0_d0*((-(model_.vde)*d_vde_t_dV_tnode_GND/vde_t/vde_t)))));
cje0_t = ((model_.cje0)*value_exp_1);
}
cje0_dc = (model_.cje0);
arg = ((0.5*(model_.vdedc))/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
vdj0 = ((2*vt0)*value_log_2);
}

d_vdjt_dV_tnode_GND = ((vdj0*d_qtt0_dV_tnode_GND+vgbe*(-d_qtt0_dV_tnode_GND))-((mg*VT)*d_ln_qtt0_dV_tnode_GND+mg*d_VT_dV_tnode_GND*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbe*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));

d_vdedc_t_dV_tnode_GND = (d_vdjt_dV_tnode_GND+((2*VT)*(deriv_log_2_d0*(0.5*(deriv_sqrt_1_d0*(4*(deriv_exp_0_d0*(((VT*(-d_vdjt_dV_tnode_GND)-(-vdjt)*d_VT_dV_tnode_GND)/VT/VT)))))))+2*d_VT_dV_tnode_GND*value_log_2));
vdedc_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log(((model_.vdedc)/vdedc_t));
double value_exp_1 = exp(((model_.zedc)*value_log_0));
double  deriv_log_0_d0 = (1.0/((model_.vdedc)/vdedc_t));
double  deriv_exp_1_d0 = value_exp_1;

d_cje0_dc_t_dV_tnode_GND = cje0_dc*(deriv_exp_1_d0*((model_.zedc)*(deriv_log_0_d0*((-(model_.vdedc)*d_vdedc_t_dV_tnode_GND/vdedc_t/vdedc_t)))));
cje0_dc_t = (cje0_dc*value_exp_1);
}

d_aje_t_dV_tnode_GND = ((model_.aje)*d_vde_t_dV_tnode_GND/(model_.vde));
aje_t = (((model_.aje)*vde_t)/(model_.vde));

d_ajedc_t_dV_tnode_GND = ((model_.ajedc)*d_vdedc_t_dV_tnode_GND/(model_.vdedc));
ajedc_t = (((model_.ajedc)*vdedc_t)/(model_.vdedc));
arg = ((0.5*(model_.vdci))/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
vdj0 = ((2*vt0)*value_log_2);
}

d_vdjt_dV_tnode_GND = ((vdj0*d_qtt0_dV_tnode_GND+vgbc*(-d_qtt0_dV_tnode_GND))-((mg*VT)*d_ln_qtt0_dV_tnode_GND+mg*d_VT_dV_tnode_GND*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));

d_vdci_t_dV_tnode_GND = (d_vdjt_dV_tnode_GND+((2*VT)*(deriv_log_2_d0*(0.5*(deriv_sqrt_1_d0*(4*(deriv_exp_0_d0*(((VT*(-d_vdjt_dV_tnode_GND)-(-vdjt)*d_VT_dV_tnode_GND)/VT/VT)))))))+2*d_VT_dV_tnode_GND*value_log_2));
vdci_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log(((model_.vdci)/vdci_t));
double value_exp_1 = exp(((model_.zci)*value_log_0));
double  deriv_log_0_d0 = (1.0/((model_.vdci)/vdci_t));
double  deriv_exp_1_d0 = value_exp_1;

d_cjci0_t_dV_tnode_GND = (model_.cjci0)*(deriv_exp_1_d0*((model_.zci)*(deriv_log_0_d0*((-(model_.vdci)*d_vdci_t_dV_tnode_GND/vdci_t/vdci_t)))));
cjci0_t = ((model_.cjci0)*value_exp_1);
}
arg = ((0.5*(model_.vdcx))/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
vdj0 = ((2*vt0)*value_log_2);
}

d_vdjt_dV_tnode_GND = ((vdj0*d_qtt0_dV_tnode_GND+vgbc*(-d_qtt0_dV_tnode_GND))-((mg*VT)*d_ln_qtt0_dV_tnode_GND+mg*d_VT_dV_tnode_GND*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));

d_vdcx_t_dV_tnode_GND = (d_vdjt_dV_tnode_GND+((2*VT)*(deriv_log_2_d0*(0.5*(deriv_sqrt_1_d0*(4*(deriv_exp_0_d0*(((VT*(-d_vdjt_dV_tnode_GND)-(-vdjt)*d_VT_dV_tnode_GND)/VT/VT)))))))+2*d_VT_dV_tnode_GND*value_log_2));
vdcx_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log(((model_.vdcx)/vdcx_t));
double value_exp_1 = exp(((model_.zcx)*value_log_0));
double  deriv_log_0_d0 = (1.0/((model_.vdcx)/vdcx_t));
double  deriv_exp_1_d0 = value_exp_1;

d_cjcx0_t_dV_tnode_GND = (model_.cjcx0)*(deriv_exp_1_d0*((model_.zcx)*(deriv_log_0_d0*((-(model_.vdcx)*d_vdcx_t_dV_tnode_GND/vdcx_t/vdcx_t)))));
cjcx0_t = ((model_.cjcx0)*value_exp_1);
}
arg = ((0.5*(model_.vds))/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
vdj0 = ((2*vt0)*value_log_2);
}

d_vdjt_dV_tnode_GND = ((vdj0*d_qtt0_dV_tnode_GND+vgsc*(-d_qtt0_dV_tnode_GND))-((mg*VT)*d_ln_qtt0_dV_tnode_GND+mg*d_VT_dV_tnode_GND*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgsc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));

d_vds_t_dV_tnode_GND = (d_vdjt_dV_tnode_GND+((2*VT)*(deriv_log_2_d0*(0.5*(deriv_sqrt_1_d0*(4*(deriv_exp_0_d0*(((VT*(-d_vdjt_dV_tnode_GND)-(-vdjt)*d_VT_dV_tnode_GND)/VT/VT)))))))+2*d_VT_dV_tnode_GND*value_log_2));
vds_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log(((model_.vds)/vds_t));
double value_exp_1 = exp(((model_.zs)*value_log_0));
double  deriv_log_0_d0 = (1.0/((model_.vds)/vds_t));
double  deriv_exp_1_d0 = value_exp_1;

d_cjs0_t_dV_tnode_GND = (model_.cjs0)*(deriv_exp_1_d0*((model_.zs)*(deriv_log_0_d0*((-(model_.vds)*d_vds_t_dV_tnode_GND/vds_t/vds_t)))));
cjs0_t = ((model_.cjs0)*value_exp_1);
}
{
double value_exp_0 = exp((((model_.zetaiqf)*ln_qtt0)-(((model_.dvgbe)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_iqf_t_dV_tnode_GND = (model_.iqf)*(deriv_exp_0_d0*(((model_.zetaiqf)*d_ln_qtt0_dV_tnode_GND-(((model_.dvgbe)/VT)*d_qtt0_dV_tnode_GND+(-(model_.dvgbe)*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
iqf_t = ((model_.iqf)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.zetaci)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_rci0_t_dV_tnode_GND = (model_.rci0)*(deriv_exp_0_d0*((model_.zetaci)*d_ln_qtt0_dV_tnode_GND));
rci0_t = ((model_.rci0)*value_exp_0);
}
{
double value_exp_0 = exp((((model_.zetaci)-avs)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_vlim_t_dV_tnode_GND = (model_.vlim)*(deriv_exp_0_d0*(((model_.zetaci)-avs)*d_ln_qtt0_dV_tnode_GND));
vlim_t = ((model_.vlim)*value_exp_0);
}

d_vces_t_dV_tnode_GND = (model_.vces)*(model_.alces)*d_dT_dV_tnode_GND;
vces_t = ((model_.vces)*(1+((model_.alces)*dT)));

d_t0_t_dV_tnode_GND = (model_.t0)*((model_.alt0)*d_dT_dV_tnode_GND+(((model_.kt0)*dT)*d_dT_dV_tnode_GND+(model_.kt0)*d_dT_dV_tnode_GND*dT));
t0_t = ((model_.t0)*((1+((model_.alt0)*dT))+(((model_.kt0)*dT)*dT)));
{
double value_exp_0 = exp((((model_.zetaci)-1)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_thcs_t_dV_tnode_GND = (model_.thcs)*(deriv_exp_0_d0*(((model_.zetaci)-1)*d_ln_qtt0_dV_tnode_GND));
thcs_t = ((model_.thcs)*value_exp_0);
}
zetatef = (((model_.zetabet)-(model_.zetact))-0.5);
dvg = ((model_.vgb)-(model_.vge));
if (((model_.tef_temp)==1))
{
{
double value_exp_0 = exp(((zetatef*ln_qtt0)-((dvg/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;

d_tef0_t_dV_tnode_GND = (model_.tef0)*(deriv_exp_0_d0*((zetatef*d_ln_qtt0_dV_tnode_GND-((dvg/VT)*d_qtt0_dV_tnode_GND+(-dvg*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1)))));
tef0_t = ((model_.tef0)*value_exp_0);
}
}
else
{

d_tef0_t_dV_tnode_GND =  0.0;
tef0_t = (model_.tef0);
}
{
double value_exp_0 = exp(((model_.zetarbx)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_rbx_t_dV_tnode_GND = (model_.rbx)*(deriv_exp_0_d0*((model_.zetarbx)*d_ln_qtt0_dV_tnode_GND));
rbx_t = ((model_.rbx)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.zetarcx)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_rcx_t_dV_tnode_GND = (model_.rcx)*(deriv_exp_0_d0*((model_.zetarcx)*d_ln_qtt0_dV_tnode_GND));
rcx_t = ((model_.rcx)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.zetarbi)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_rbi0_t_dV_tnode_GND = (model_.rbi0)*(deriv_exp_0_d0*((model_.zetarbi)*d_ln_qtt0_dV_tnode_GND));
rbi0_t = ((model_.rbi0)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.zetare)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_re_t_dV_tnode_GND = (model_.re)*(deriv_exp_0_d0*((model_.zetare)*d_ln_qtt0_dV_tnode_GND));
re_t = ((model_.re)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.aleav)*dT));
double  deriv_exp_0_d0 = value_exp_0;

d_eavl_t_dV_tnode_GND = (model_.eavl)*(deriv_exp_0_d0*((model_.aleav)*d_dT_dV_tnode_GND));
eavl_t = ((model_.eavl)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.alkav)*dT));
double  deriv_exp_0_d0 = value_exp_0;

d_kavl_t_dV_tnode_GND = (model_.kavl)*(deriv_exp_0_d0*((model_.alkav)*d_dT_dV_tnode_GND));
kavl_t = ((model_.kavl)*value_exp_0);
}
if (((model_.zetarth)!=0))
{
{
double value_log_0 = log((Tdev/Tnom));
double value_exp_1 = exp(((model_.zetarth)*value_log_0));
double  deriv_log_0_d0 = (1.0/(Tdev/Tnom));
double  deriv_exp_1_d0 = value_exp_1;
rth_t = ((model_.rth)*value_exp_1);
}
}
else
{
rth_t = (model_.rth);
}
{
double value_exp_0 = exp(((model_.zetaver)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;

d_aver_t_dV_tnode_GND = (model_.aver)*(deriv_exp_0_d0*((model_.zetaver)*d_ln_qtt0_dV_tnode_GND));
aver_t = ((model_.aver)*value_exp_0);
}
{
double value_exp_0 = exp(((model_.zetavgbe)*ln_qtt0));
double value_exp_1 = exp((((model_.dvgbe)/VT)*(value_exp_0-1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;

d_ver_t_dV_tnode_GND = (-(model_.ver)*(deriv_exp_1_d0*((((model_.dvgbe)/VT)*(deriv_exp_0_d0*((model_.zetavgbe)*d_ln_qtt0_dV_tnode_GND))+(-(model_.dvgbe)*d_VT_dV_tnode_GND/VT/VT)*(value_exp_0-1))))/value_exp_1/value_exp_1);
ver_t = ((model_.ver)/value_exp_1);
}

d_iqfh_t_dV_tnode_GND = (model_.iqfh)*((model_.aliqfh)*d_dT_dV_tnode_GND+(((model_.kiqfh)*dT)*d_dT_dV_tnode_GND+(model_.kiqfh)*d_dT_dV_tnode_GND*dT));
iqfh_t = ((model_.iqfh)*((1+((model_.aliqfh)*dT))+(((model_.kiqfh)*dT)*dT)));
{
double value_exp_0 = exp(((((model_.vgb)-(model_.vge))/VT)*(qtt0-1)));
double  deriv_exp_0_d0 = value_exp_0;

d_tfh_t_dV_tnode_GND = (((model_.tfh)*((1+((model_.aliqfh)*dT))+(((model_.kiqfh)*dT)*dT)))*(deriv_exp_0_d0*(((((model_.vgb)-(model_.vge))/VT)*d_qtt0_dV_tnode_GND+(-((model_.vgb)-(model_.vge))*d_VT_dV_tnode_GND/VT/VT)*(qtt0-1))))+(model_.tfh)*((model_.aliqfh)*d_dT_dV_tnode_GND+(((model_.kiqfh)*dT)*d_dT_dV_tnode_GND+(model_.kiqfh)*d_dT_dV_tnode_GND*dT))*value_exp_0);
tfh_t = (((model_.tfh)*((1+((model_.aliqfh)*dT))+(((model_.kiqfh)*dT)*dT)))*value_exp_0);
}
ahq_t = (model_.ahq);
if ((cjcx0_t==0))
{

d_cjci0_t_ii_dV_tnode_GND = d_cjci0_t_dV_tnode_GND*(model_.fbc);
cjci0_t_ii = (cjci0_t*(model_.fbc));

d_qjcxi_dV_bi_ci = d_qjcxi_dV_tnode_GND = d_qjcxi_dV_b_ci =  0.0;
qjcxi = 0;

d_cjcx0_t_i_dV_tnode_GND = d_cjci0_t_dV_tnode_GND*(1-(model_.fbc));
cjcx0_t_i = (cjci0_t*(1-(model_.fbc)));
if (((model_.vptci)<1.0e2))
{
if ((cjcx0_t_i>0.0))
{
zr = ((model_.zci)/4.0);

d_vp_dV_tnode_GND = (-d_vdci_t_dV_tnode_GND);
vp = ((model_.vptci)-vdci_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zci)));

d_vf_dV_tnode_GND = d_vdci_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdci_t*(1.0-value_exp_1));
}

d_cmax_dV_tnode_GND = 2.4*d_cjcx0_t_i_dV_tnode_GND;
cmax = (2.4*cjcx0_t_i);
{
double value_log_0 = log((vdci_t/(model_.vptci)));
double value_exp_1 = exp((((model_.zci)-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdci_t/(model_.vptci)));
double  deriv_exp_1_d0 = value_exp_1;

d_cr_dV_tnode_GND = (cjcx0_t_i*(deriv_exp_1_d0*(((model_.zci)-zr)*(deriv_log_0_d0*((d_vdci_t_dV_tnode_GND/(model_.vptci))))))+d_cjcx0_t_i_dV_tnode_GND*value_exp_1);
cr = (cjcx0_t_i*value_exp_1);
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = d_VT_dV_tnode_GND;
a = VT;

d_ve_dV_s_ci = d_ve_dV_ci_ei = d_ve_dV_bi_ei = d_ve_dV_bi_ci =  0.0;
d_ve_dV_b_ci = ((a*(-d_Vbci_dV_b_ci)-(vf-Vbci)*d_a_dV_b_ci)/a/a);
d_ve_dV_tnode_GND = ((a*d_vf_dV_tnode_GND-(vf-Vbci)*d_a_dV_tnode_GND)/a/a);
ve = ((vf-Vbci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei = d_ex1_dV_bi_ci =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_ve_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_ve_dV_tnode_GND));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei = d_ee1_dV_bi_ci =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci = d_vj1_dV_bi_ci =  0.0;
d_vj1_dV_b_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0));
d_vj1_dV_tnode_GND = (d_vf_dV_tnode_GND-(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci = d_vj1_dV_bi_ci = d_vj1_dV_tnode_GND =  0.0;
d_vj1_dV_b_ci = d_Vbci_dV_b_ci;
vj1 = Vbci;
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = (0.1*d_vp_dV_tnode_GND+4.0*d_VT_dV_tnode_GND);
a = ((0.1*vp)+(4.0*VT));

d_vr_dV_ci_ei = d_vr_dV_bi_ei = d_vr_dV_s_ci = d_vr_dV_bi_ci =  0.0;
d_vr_dV_b_ci = ((a*d_vj1_dV_b_ci-(vp+vj1)*d_a_dV_b_ci)/a/a);
d_vr_dV_tnode_GND = ((a*(d_vp_dV_tnode_GND+d_vj1_dV_tnode_GND)-(vp+vj1)*d_a_dV_tnode_GND)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei = d_ex1_dV_bi_ci =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_vr_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_vr_dV_tnode_GND));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei = d_ee1_dV_bi_ci =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci = d_vj2_dV_bi_ci =  0.0;
d_vj2_dV_b_ci = (a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0);
d_vj2_dV_tnode_GND = ((-d_vp_dV_tnode_GND)+(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci = d_vj2_dV_bi_ci =  0.0;
d_vj2_dV_b_ci = d_vj1_dV_b_ci;
d_vj2_dV_tnode_GND = d_vj1_dV_tnode_GND;
vj2 = vj1;
}

d_vj4_dV_s_ci = d_vj4_dV_ci_ei = d_vj4_dV_bi_ei = d_vj4_dV_bi_ci =  0.0;
d_vj4_dV_tnode_GND = (-d_vj1_dV_tnode_GND);
d_vj4_dV_b_ci = (d_Vbci_dV_b_ci-d_vj1_dV_b_ci);
vj4 = (Vbci-vj1);
ez = (1.0-(model_.zci));
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdci_t)));

d_vdj1_dV_ci_ei = d_vdj1_dV_bi_ei = d_vdj1_dV_s_ci = d_vdj1_dV_bi_ci =  0.0;
d_vdj1_dV_b_ci = (deriv_log_0_d0*((-(d_vj1_dV_b_ci/vdci_t))));
d_vdj1_dV_tnode_GND = (deriv_log_0_d0*((-((vdci_t*d_vj1_dV_tnode_GND-vj1*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdci_t)));

d_vdj2_dV_ci_ei = d_vdj2_dV_bi_ei = d_vdj2_dV_s_ci = d_vdj2_dV_bi_ci =  0.0;
d_vdj2_dV_b_ci = (deriv_log_0_d0*((-(d_vj2_dV_b_ci/vdci_t))));
d_vdj2_dV_tnode_GND = (deriv_log_0_d0*((-((vdci_t*d_vj2_dV_tnode_GND-vj2*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;

d_qj1_dV_ci_ei = d_qj1_dV_bi_ei = d_qj1_dV_s_ci = d_qj1_dV_bi_ci =  0.0;
d_qj1_dV_b_ci = (cjcx0_t_i*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ez)))/ez);
d_qj1_dV_tnode_GND = ((cjcx0_t_i*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ez)))+d_cjcx0_t_i_dV_tnode_GND*(1.0-value_exp_0))/ez);
qj1 = ((cjcx0_t_i*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj2_dV_ci_ei = d_qj2_dV_bi_ei = d_qj2_dV_s_ci = d_qj2_dV_bi_ci =  0.0;
d_qj2_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_b_ci*ezr)))/ezr);
d_qj2_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj1_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj3_dV_ci_ei = d_qj3_dV_bi_ei = d_qj3_dV_s_ci = d_qj3_dV_bi_ci =  0.0;
d_qj3_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ezr)))/ezr);
d_qj3_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}

d_qjcx_dV_bi_ci =  0.0;
d_qjcx_dV_b_ci = (((d_qj1_dV_b_ci+d_qj2_dV_b_ci)-d_qj3_dV_b_ci)*vdci_t+cmax*d_vj4_dV_b_ci);
d_qjcx_dV_tnode_GND = ((((qj1+qj2)-qj3)*d_vdci_t_dV_tnode_GND+((d_qj1_dV_tnode_GND+d_qj2_dV_tnode_GND)-d_qj3_dV_tnode_GND)*vdci_t)+(cmax*d_vj4_dV_tnode_GND+d_cmax_dV_tnode_GND*vj4));
qjcx = ((((qj1+qj2)-qj3)*vdci_t)+(cmax*vj4));
}
else
{

d_qjcx_dV_bi_ci = d_qjcx_dV_tnode_GND = d_qjcx_dV_b_ci =  0.0;
qjcx = 0.0;
}
}
else
{
if ((cjcx0_t_i>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zci)));

d_vf_dV_tnode_GND = d_vdci_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdci_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ei = d_xvf_dV_bi_ci =  0.0;
d_xvf_dV_b_ci = ((-d_Vbci_dV_b_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbci)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci = d_xvf2_dV_bi_ei = d_xvf2_dV_bi_ci =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci = d_v_j_dV_bi_ei = d_v_j_dV_bi_ci =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zci));
{
double value_log_0 = log((1.0-(v_j/vdci_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci = d_y_dV_ci_ei = d_y_dV_bi_ei = d_y_dV_bi_ci =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdci_t)))))));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vdci_t*d_v_j_dV_tnode_GND-v_j*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))))+d_x_dV_tnode_GND*value_log_0))));
y = (1.0-value_exp_1);
}

d_qjcx_dV_bi_ci =  0.0;
d_qjcx_dV_b_ci = (((cjcx0_t_i*vdci_t)*d_y_dV_b_ci/x)+(2.4*cjcx0_t_i)*(d_Vbci_dV_b_ci-d_v_j_dV_b_ci));
d_qjcx_dV_tnode_GND = (((x*((cjcx0_t_i*vdci_t)*d_y_dV_tnode_GND+(cjcx0_t_i*d_vdci_t_dV_tnode_GND+d_cjcx0_t_i_dV_tnode_GND*vdci_t)*y)-((cjcx0_t_i*vdci_t)*y)*d_x_dV_tnode_GND)/x/x)+((2.4*cjcx0_t_i)*(-d_v_j_dV_tnode_GND)+2.4*d_cjcx0_t_i_dV_tnode_GND*(Vbci-v_j)));
qjcx = ((((cjcx0_t_i*vdci_t)*y)/x)+((2.4*cjcx0_t_i)*(Vbci-v_j)));
}
else
{

d_qjcx_dV_bi_ci = d_qjcx_dV_tnode_GND = d_qjcx_dV_b_ci =  0.0;
qjcx = 0.00;
}
}
}
else
{

d_cjci0_t_ii_dV_tnode_GND = d_cjci0_t_dV_tnode_GND;
cjci0_t_ii = cjci0_t;

d_cjcx0_t_ii_dV_tnode_GND = d_cjcx0_t_dV_tnode_GND*(model_.fbc);
cjcx0_t_ii = (cjcx0_t*(model_.fbc));
if (((model_.vptcx)<1.0e2))
{
if ((cjcx0_t_ii>0.0))
{
zr = ((model_.zcx)/4.0);

d_vp_dV_tnode_GND = (-d_vdcx_t_dV_tnode_GND);
vp = ((model_.vptcx)-vdcx_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zcx)));

d_vf_dV_tnode_GND = d_vdcx_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdcx_t*(1.0-value_exp_1));
}

d_cmax_dV_tnode_GND = 2.4*d_cjcx0_t_ii_dV_tnode_GND;
cmax = (2.4*cjcx0_t_ii);
{
double value_log_0 = log((vdcx_t/(model_.vptcx)));
double value_exp_1 = exp((((model_.zcx)-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdcx_t/(model_.vptcx)));
double  deriv_exp_1_d0 = value_exp_1;

d_cr_dV_tnode_GND = (cjcx0_t_ii*(deriv_exp_1_d0*(((model_.zcx)-zr)*(deriv_log_0_d0*((d_vdcx_t_dV_tnode_GND/(model_.vptcx))))))+d_cjcx0_t_ii_dV_tnode_GND*value_exp_1);
cr = (cjcx0_t_ii*value_exp_1);
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = d_VT_dV_tnode_GND;
a = VT;

d_ve_dV_s_ci = d_ve_dV_ci_ei = d_ve_dV_bi_ei = d_ve_dV_b_ci =  0.0;
d_ve_dV_bi_ci = ((a*(-d_Vbici_dV_bi_ci)-(vf-Vbici)*d_a_dV_bi_ci)/a/a);
d_ve_dV_tnode_GND = ((a*d_vf_dV_tnode_GND-(vf-Vbici)*d_a_dV_tnode_GND)/a/a);
ve = ((vf-Vbici)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_ve_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_ve_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_ve_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci =  0.0;
d_vj1_dV_b_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0));
d_vj1_dV_bi_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0));
d_vj1_dV_tnode_GND = (d_vf_dV_tnode_GND-(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci = d_vj1_dV_tnode_GND = d_vj1_dV_b_ci =  0.0;
d_vj1_dV_bi_ci = d_Vbici_dV_bi_ci;
vj1 = Vbici;
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = (0.1*d_vp_dV_tnode_GND+4.0*d_VT_dV_tnode_GND);
a = ((0.1*vp)+(4.0*VT));

d_vr_dV_ci_ei = d_vr_dV_bi_ei = d_vr_dV_s_ci =  0.0;
d_vr_dV_b_ci = ((a*d_vj1_dV_b_ci-(vp+vj1)*d_a_dV_b_ci)/a/a);
d_vr_dV_bi_ci = ((a*d_vj1_dV_bi_ci-(vp+vj1)*d_a_dV_bi_ci)/a/a);
d_vr_dV_tnode_GND = ((a*(d_vp_dV_tnode_GND+d_vj1_dV_tnode_GND)-(vp+vj1)*d_a_dV_tnode_GND)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_vr_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_vr_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_vr_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = (a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0);
d_vj2_dV_bi_ci = (a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0);
d_vj2_dV_tnode_GND = ((-d_vp_dV_tnode_GND)+(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = d_vj1_dV_b_ci;
d_vj2_dV_tnode_GND = d_vj1_dV_tnode_GND;
d_vj2_dV_bi_ci = d_vj1_dV_bi_ci;
vj2 = vj1;
}

d_vj4_dV_s_ci = d_vj4_dV_ci_ei = d_vj4_dV_bi_ei =  0.0;
d_vj4_dV_b_ci = (-d_vj1_dV_b_ci);
d_vj4_dV_tnode_GND = (-d_vj1_dV_tnode_GND);
d_vj4_dV_bi_ci = (d_Vbici_dV_bi_ci-d_vj1_dV_bi_ci);
vj4 = (Vbici-vj1);
ez = (1.0-(model_.zcx));
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdcx_t)));

d_vdj1_dV_ci_ei = d_vdj1_dV_bi_ei = d_vdj1_dV_s_ci =  0.0;
d_vdj1_dV_b_ci = (deriv_log_0_d0*((-(d_vj1_dV_b_ci/vdcx_t))));
d_vdj1_dV_tnode_GND = (deriv_log_0_d0*((-((vdcx_t*d_vj1_dV_tnode_GND-vj1*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))));
d_vdj1_dV_bi_ci = (deriv_log_0_d0*((-(d_vj1_dV_bi_ci/vdcx_t))));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdcx_t)));

d_vdj2_dV_ci_ei = d_vdj2_dV_bi_ei = d_vdj2_dV_s_ci =  0.0;
d_vdj2_dV_b_ci = (deriv_log_0_d0*((-(d_vj2_dV_b_ci/vdcx_t))));
d_vdj2_dV_tnode_GND = (deriv_log_0_d0*((-((vdcx_t*d_vj2_dV_tnode_GND-vj2*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))));
d_vdj2_dV_bi_ci = (deriv_log_0_d0*((-(d_vj2_dV_bi_ci/vdcx_t))));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;

d_qj1_dV_ci_ei = d_qj1_dV_bi_ei = d_qj1_dV_s_ci =  0.0;
d_qj1_dV_b_ci = (cjcx0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ez)))/ez);
d_qj1_dV_bi_ci = (cjcx0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ez)))/ez);
d_qj1_dV_tnode_GND = ((cjcx0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ez)))+d_cjcx0_t_ii_dV_tnode_GND*(1.0-value_exp_0))/ez);
qj1 = ((cjcx0_t_ii*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj2_dV_ci_ei = d_qj2_dV_bi_ei = d_qj2_dV_s_ci =  0.0;
d_qj2_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_b_ci*ezr)))/ezr);
d_qj2_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_bi_ci*ezr)))/ezr);
d_qj2_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj1_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj3_dV_ci_ei = d_qj3_dV_bi_ei = d_qj3_dV_s_ci =  0.0;
d_qj3_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ezr)))/ezr);
d_qj3_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ezr)))/ezr);
d_qj3_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}

d_qjcxi_dV_b_ci = (((d_qj1_dV_b_ci+d_qj2_dV_b_ci)-d_qj3_dV_b_ci)*vdcx_t+cmax*d_vj4_dV_b_ci);
d_qjcxi_dV_tnode_GND = ((((qj1+qj2)-qj3)*d_vdcx_t_dV_tnode_GND+((d_qj1_dV_tnode_GND+d_qj2_dV_tnode_GND)-d_qj3_dV_tnode_GND)*vdcx_t)+(cmax*d_vj4_dV_tnode_GND+d_cmax_dV_tnode_GND*vj4));
d_qjcxi_dV_bi_ci = (((d_qj1_dV_bi_ci+d_qj2_dV_bi_ci)-d_qj3_dV_bi_ci)*vdcx_t+cmax*d_vj4_dV_bi_ci);
qjcxi = ((((qj1+qj2)-qj3)*vdcx_t)+(cmax*vj4));
}
else
{

d_qjcxi_dV_bi_ci = d_qjcxi_dV_tnode_GND = d_qjcxi_dV_b_ci =  0.0;
qjcxi = 0.0;
}
}
else
{
if ((cjcx0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zcx)));

d_vf_dV_tnode_GND = d_vdcx_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdcx_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ei = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_bi_ci = ((-d_Vbici_dV_bi_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbici)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci = d_xvf2_dV_bi_ei =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci = d_v_j_dV_bi_ei =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zcx));
{
double value_log_0 = log((1.0-(v_j/vdcx_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdcx_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci = d_y_dV_ci_ei = d_y_dV_bi_ei =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdcx_t)))))));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vdcx_t*d_v_j_dV_tnode_GND-v_j*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))))+d_x_dV_tnode_GND*value_log_0))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vdcx_t)))))));
y = (1.0-value_exp_1);
}

d_qjcxi_dV_b_ci = (((cjcx0_t_ii*vdcx_t)*d_y_dV_b_ci/x)+(2.4*cjcx0_t_ii)*(-d_v_j_dV_b_ci));
d_qjcxi_dV_bi_ci = (((cjcx0_t_ii*vdcx_t)*d_y_dV_bi_ci/x)+(2.4*cjcx0_t_ii)*(d_Vbici_dV_bi_ci-d_v_j_dV_bi_ci));
d_qjcxi_dV_tnode_GND = (((x*((cjcx0_t_ii*vdcx_t)*d_y_dV_tnode_GND+(cjcx0_t_ii*d_vdcx_t_dV_tnode_GND+d_cjcx0_t_ii_dV_tnode_GND*vdcx_t)*y)-((cjcx0_t_ii*vdcx_t)*y)*d_x_dV_tnode_GND)/x/x)+((2.4*cjcx0_t_ii)*(-d_v_j_dV_tnode_GND)+2.4*d_cjcx0_t_ii_dV_tnode_GND*(Vbici-v_j)));
qjcxi = ((((cjcx0_t_ii*vdcx_t)*y)/x)+((2.4*cjcx0_t_ii)*(Vbici-v_j)));
}
else
{

d_qjcxi_dV_bi_ci = d_qjcxi_dV_tnode_GND = d_qjcxi_dV_b_ci =  0.0;
qjcxi = 0.00;
}
}

d_cjcx0_t_i_dV_tnode_GND = d_cjcx0_t_dV_tnode_GND*(1-(model_.fbc));
cjcx0_t_i = (cjcx0_t*(1-(model_.fbc)));
if (((model_.vptcx)<1.0e2))
{
if ((cjcx0_t_i>0.0))
{
zr = ((model_.zcx)/4.0);

d_vp_dV_tnode_GND = (-d_vdcx_t_dV_tnode_GND);
vp = ((model_.vptcx)-vdcx_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zcx)));

d_vf_dV_tnode_GND = d_vdcx_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdcx_t*(1.0-value_exp_1));
}

d_cmax_dV_tnode_GND = 2.4*d_cjcx0_t_i_dV_tnode_GND;
cmax = (2.4*cjcx0_t_i);
{
double value_log_0 = log((vdcx_t/(model_.vptcx)));
double value_exp_1 = exp((((model_.zcx)-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdcx_t/(model_.vptcx)));
double  deriv_exp_1_d0 = value_exp_1;

d_cr_dV_tnode_GND = (cjcx0_t_i*(deriv_exp_1_d0*(((model_.zcx)-zr)*(deriv_log_0_d0*((d_vdcx_t_dV_tnode_GND/(model_.vptcx))))))+d_cjcx0_t_i_dV_tnode_GND*value_exp_1);
cr = (cjcx0_t_i*value_exp_1);
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = d_VT_dV_tnode_GND;
a = VT;

d_ve_dV_s_ci = d_ve_dV_ci_ei = d_ve_dV_bi_ei = d_ve_dV_bi_ci =  0.0;
d_ve_dV_b_ci = ((a*(-d_Vbci_dV_b_ci)-(vf-Vbci)*d_a_dV_b_ci)/a/a);
d_ve_dV_tnode_GND = ((a*d_vf_dV_tnode_GND-(vf-Vbci)*d_a_dV_tnode_GND)/a/a);
ve = ((vf-Vbci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_ve_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_ve_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_ve_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci =  0.0;
d_vj1_dV_b_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0));
d_vj1_dV_bi_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0));
d_vj1_dV_tnode_GND = (d_vf_dV_tnode_GND-(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci = d_vj1_dV_bi_ci = d_vj1_dV_tnode_GND =  0.0;
d_vj1_dV_b_ci = d_Vbci_dV_b_ci;
vj1 = Vbci;
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = (0.1*d_vp_dV_tnode_GND+4.0*d_VT_dV_tnode_GND);
a = ((0.1*vp)+(4.0*VT));

d_vr_dV_ci_ei = d_vr_dV_bi_ei = d_vr_dV_s_ci =  0.0;
d_vr_dV_b_ci = ((a*d_vj1_dV_b_ci-(vp+vj1)*d_a_dV_b_ci)/a/a);
d_vr_dV_bi_ci = ((a*d_vj1_dV_bi_ci-(vp+vj1)*d_a_dV_bi_ci)/a/a);
d_vr_dV_tnode_GND = ((a*(d_vp_dV_tnode_GND+d_vj1_dV_tnode_GND)-(vp+vj1)*d_a_dV_tnode_GND)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_vr_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_vr_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_vr_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = (a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0);
d_vj2_dV_bi_ci = (a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0);
d_vj2_dV_tnode_GND = ((-d_vp_dV_tnode_GND)+(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = d_vj1_dV_b_ci;
d_vj2_dV_tnode_GND = d_vj1_dV_tnode_GND;
d_vj2_dV_bi_ci = d_vj1_dV_bi_ci;
vj2 = vj1;
}

d_vj4_dV_s_ci = d_vj4_dV_ci_ei = d_vj4_dV_bi_ei =  0.0;
d_vj4_dV_tnode_GND = (-d_vj1_dV_tnode_GND);
d_vj4_dV_bi_ci = (-d_vj1_dV_bi_ci);
d_vj4_dV_b_ci = (d_Vbci_dV_b_ci-d_vj1_dV_b_ci);
vj4 = (Vbci-vj1);
ez = (1.0-(model_.zcx));
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdcx_t)));

d_vdj1_dV_ci_ei = d_vdj1_dV_bi_ei = d_vdj1_dV_s_ci =  0.0;
d_vdj1_dV_b_ci = (deriv_log_0_d0*((-(d_vj1_dV_b_ci/vdcx_t))));
d_vdj1_dV_tnode_GND = (deriv_log_0_d0*((-((vdcx_t*d_vj1_dV_tnode_GND-vj1*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))));
d_vdj1_dV_bi_ci = (deriv_log_0_d0*((-(d_vj1_dV_bi_ci/vdcx_t))));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdcx_t)));

d_vdj2_dV_ci_ei = d_vdj2_dV_bi_ei = d_vdj2_dV_s_ci =  0.0;
d_vdj2_dV_b_ci = (deriv_log_0_d0*((-(d_vj2_dV_b_ci/vdcx_t))));
d_vdj2_dV_tnode_GND = (deriv_log_0_d0*((-((vdcx_t*d_vj2_dV_tnode_GND-vj2*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))));
d_vdj2_dV_bi_ci = (deriv_log_0_d0*((-(d_vj2_dV_bi_ci/vdcx_t))));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;

d_qj1_dV_ci_ei = d_qj1_dV_bi_ei = d_qj1_dV_s_ci =  0.0;
d_qj1_dV_b_ci = (cjcx0_t_i*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ez)))/ez);
d_qj1_dV_bi_ci = (cjcx0_t_i*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ez)))/ez);
d_qj1_dV_tnode_GND = ((cjcx0_t_i*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ez)))+d_cjcx0_t_i_dV_tnode_GND*(1.0-value_exp_0))/ez);
qj1 = ((cjcx0_t_i*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj2_dV_ci_ei = d_qj2_dV_bi_ei = d_qj2_dV_s_ci =  0.0;
d_qj2_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_b_ci*ezr)))/ezr);
d_qj2_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_bi_ci*ezr)))/ezr);
d_qj2_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj1_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj3_dV_ci_ei = d_qj3_dV_bi_ei = d_qj3_dV_s_ci =  0.0;
d_qj3_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ezr)))/ezr);
d_qj3_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ezr)))/ezr);
d_qj3_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}

d_qjcx_dV_b_ci = (((d_qj1_dV_b_ci+d_qj2_dV_b_ci)-d_qj3_dV_b_ci)*vdcx_t+cmax*d_vj4_dV_b_ci);
d_qjcx_dV_tnode_GND = ((((qj1+qj2)-qj3)*d_vdcx_t_dV_tnode_GND+((d_qj1_dV_tnode_GND+d_qj2_dV_tnode_GND)-d_qj3_dV_tnode_GND)*vdcx_t)+(cmax*d_vj4_dV_tnode_GND+d_cmax_dV_tnode_GND*vj4));
d_qjcx_dV_bi_ci = (((d_qj1_dV_bi_ci+d_qj2_dV_bi_ci)-d_qj3_dV_bi_ci)*vdcx_t+cmax*d_vj4_dV_bi_ci);
qjcx = ((((qj1+qj2)-qj3)*vdcx_t)+(cmax*vj4));
}
else
{

d_qjcx_dV_bi_ci = d_qjcx_dV_tnode_GND = d_qjcx_dV_b_ci =  0.0;
qjcx = 0.0;
}
}
else
{
if ((cjcx0_t_i>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zcx)));

d_vf_dV_tnode_GND = d_vdcx_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdcx_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ei = d_xvf_dV_bi_ci =  0.0;
d_xvf_dV_b_ci = ((-d_Vbci_dV_b_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbci)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci = d_xvf2_dV_bi_ei =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci = d_v_j_dV_bi_ei =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zcx));
{
double value_log_0 = log((1.0-(v_j/vdcx_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdcx_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci = d_y_dV_ci_ei = d_y_dV_bi_ei =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdcx_t)))))));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vdcx_t*d_v_j_dV_tnode_GND-v_j*d_vdcx_t_dV_tnode_GND)/vdcx_t/vdcx_t))))+d_x_dV_tnode_GND*value_log_0))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vdcx_t)))))));
y = (1.0-value_exp_1);
}

d_qjcx_dV_b_ci = (((cjcx0_t_i*vdcx_t)*d_y_dV_b_ci/x)+(2.4*cjcx0_t_i)*(d_Vbci_dV_b_ci-d_v_j_dV_b_ci));
d_qjcx_dV_bi_ci = (((cjcx0_t_i*vdcx_t)*d_y_dV_bi_ci/x)+(2.4*cjcx0_t_i)*(-d_v_j_dV_bi_ci));
d_qjcx_dV_tnode_GND = (((x*((cjcx0_t_i*vdcx_t)*d_y_dV_tnode_GND+(cjcx0_t_i*d_vdcx_t_dV_tnode_GND+d_cjcx0_t_i_dV_tnode_GND*vdcx_t)*y)-((cjcx0_t_i*vdcx_t)*y)*d_x_dV_tnode_GND)/x/x)+((2.4*cjcx0_t_i)*(-d_v_j_dV_tnode_GND)+2.4*d_cjcx0_t_i_dV_tnode_GND*(Vbci-v_j)));
qjcx = ((((cjcx0_t_i*vdcx_t)*y)/x)+((2.4*cjcx0_t_i)*(Vbci-v_j)));
}
else
{

d_qjcx_dV_bi_ci = d_qjcx_dV_tnode_GND = d_qjcx_dV_b_ci =  0.0;
qjcx = 0.00;
}
}
}
if (((model_.vptci)<1.0e2))
{
if ((cjci0_t_ii>0.0))
{
zr = ((model_.zci)/4.0);

d_vp_dV_tnode_GND = (-d_vdci_t_dV_tnode_GND);
vp = ((model_.vptci)-vdci_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zci)));

d_vf_dV_tnode_GND = d_vdci_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdci_t*(1.0-value_exp_1));
}

d_cmax_dV_tnode_GND = 2.4*d_cjci0_t_ii_dV_tnode_GND;
cmax = (2.4*cjci0_t_ii);
{
double value_log_0 = log((vdci_t/(model_.vptci)));
double value_exp_1 = exp((((model_.zci)-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdci_t/(model_.vptci)));
double  deriv_exp_1_d0 = value_exp_1;

d_cr_dV_tnode_GND = (cjci0_t_ii*(deriv_exp_1_d0*(((model_.zci)-zr)*(deriv_log_0_d0*((d_vdci_t_dV_tnode_GND/(model_.vptci))))))+d_cjci0_t_ii_dV_tnode_GND*value_exp_1);
cr = (cjci0_t_ii*value_exp_1);
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = d_VT_dV_tnode_GND;
a = VT;

d_ve_dV_s_ci = d_ve_dV_ci_ei = d_ve_dV_bi_ei = d_ve_dV_b_ci =  0.0;
d_ve_dV_bi_ci = ((a*(-d_Vbici_dV_bi_ci)-(vf-Vbici)*d_a_dV_bi_ci)/a/a);
d_ve_dV_tnode_GND = ((a*d_vf_dV_tnode_GND-(vf-Vbici)*d_a_dV_tnode_GND)/a/a);
ve = ((vf-Vbici)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_ve_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_ve_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_ve_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci =  0.0;
d_vj1_dV_b_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0));
d_vj1_dV_bi_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0));
d_vj1_dV_tnode_GND = (d_vf_dV_tnode_GND-(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_s_ci = d_vj1_dV_tnode_GND = d_vj1_dV_b_ci =  0.0;
d_vj1_dV_bi_ci = d_Vbici_dV_bi_ci;
vj1 = Vbici;
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = (0.1*d_vp_dV_tnode_GND+4.0*d_VT_dV_tnode_GND);
a = ((0.1*vp)+(4.0*VT));

d_vr_dV_ci_ei = d_vr_dV_bi_ei = d_vr_dV_s_ci =  0.0;
d_vr_dV_b_ci = ((a*d_vj1_dV_b_ci-(vp+vj1)*d_a_dV_b_ci)/a/a);
d_vr_dV_bi_ci = ((a*d_vj1_dV_bi_ci-(vp+vj1)*d_a_dV_bi_ci)/a/a);
d_vr_dV_tnode_GND = ((a*(d_vp_dV_tnode_GND+d_vj1_dV_tnode_GND)-(vp+vj1)*d_a_dV_tnode_GND)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_s_ci = d_ex1_dV_ci_ei = d_ex1_dV_bi_ei =  0.0;
d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_vr_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_vr_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_vr_dV_bi_ci));
ex1 = value_exp_0;
}

d_ee1_dV_s_ci = d_ee1_dV_ci_ei = d_ee1_dV_bi_ei =  0.0;
d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = (a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0);
d_vj2_dV_bi_ci = (a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0);
d_vj2_dV_tnode_GND = ((-d_vp_dV_tnode_GND)+(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{

d_vj2_dV_ci_ei = d_vj2_dV_bi_ei = d_vj2_dV_s_ci =  0.0;
d_vj2_dV_b_ci = d_vj1_dV_b_ci;
d_vj2_dV_tnode_GND = d_vj1_dV_tnode_GND;
d_vj2_dV_bi_ci = d_vj1_dV_bi_ci;
vj2 = vj1;
}

d_vj4_dV_s_ci = d_vj4_dV_ci_ei = d_vj4_dV_bi_ei =  0.0;
d_vj4_dV_b_ci = (-d_vj1_dV_b_ci);
d_vj4_dV_tnode_GND = (-d_vj1_dV_tnode_GND);
d_vj4_dV_bi_ci = (d_Vbici_dV_bi_ci-d_vj1_dV_bi_ci);
vj4 = (Vbici-vj1);
ez = (1.0-(model_.zci));
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdci_t)));

d_vdj1_dV_ci_ei = d_vdj1_dV_bi_ei = d_vdj1_dV_s_ci =  0.0;
d_vdj1_dV_b_ci = (deriv_log_0_d0*((-(d_vj1_dV_b_ci/vdci_t))));
d_vdj1_dV_tnode_GND = (deriv_log_0_d0*((-((vdci_t*d_vj1_dV_tnode_GND-vj1*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))));
d_vdj1_dV_bi_ci = (deriv_log_0_d0*((-(d_vj1_dV_bi_ci/vdci_t))));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdci_t)));

d_vdj2_dV_ci_ei = d_vdj2_dV_bi_ei = d_vdj2_dV_s_ci =  0.0;
d_vdj2_dV_b_ci = (deriv_log_0_d0*((-(d_vj2_dV_b_ci/vdci_t))));
d_vdj2_dV_tnode_GND = (deriv_log_0_d0*((-((vdci_t*d_vj2_dV_tnode_GND-vj2*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))));
d_vdj2_dV_bi_ci = (deriv_log_0_d0*((-(d_vj2_dV_bi_ci/vdci_t))));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;

d_qj1_dV_ci_ei = d_qj1_dV_bi_ei = d_qj1_dV_s_ci =  0.0;
d_qj1_dV_b_ci = (cjci0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ez)))/ez);
d_qj1_dV_bi_ci = (cjci0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ez)))/ez);
d_qj1_dV_tnode_GND = ((cjci0_t_ii*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ez)))+d_cjci0_t_ii_dV_tnode_GND*(1.0-value_exp_0))/ez);
qj1 = ((cjci0_t_ii*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj2_dV_ci_ei = d_qj2_dV_bi_ei = d_qj2_dV_s_ci =  0.0;
d_qj2_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_b_ci*ezr)))/ezr);
d_qj2_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_bi_ci*ezr)))/ezr);
d_qj2_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj1_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj3_dV_ci_ei = d_qj3_dV_bi_ei = d_qj3_dV_s_ci =  0.0;
d_qj3_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ezr)))/ezr);
d_qj3_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ezr)))/ezr);
d_qj3_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}

d_qjci_dV_b_ci = (((d_qj1_dV_b_ci+d_qj2_dV_b_ci)-d_qj3_dV_b_ci)*vdci_t+cmax*d_vj4_dV_b_ci);
d_qjci_dV_tnode_GND = ((((qj1+qj2)-qj3)*d_vdci_t_dV_tnode_GND+((d_qj1_dV_tnode_GND+d_qj2_dV_tnode_GND)-d_qj3_dV_tnode_GND)*vdci_t)+(cmax*d_vj4_dV_tnode_GND+d_cmax_dV_tnode_GND*vj4));
d_qjci_dV_bi_ci = (((d_qj1_dV_bi_ci+d_qj2_dV_bi_ci)-d_qj3_dV_bi_ci)*vdci_t+cmax*d_vj4_dV_bi_ci);
qjci = ((((qj1+qj2)-qj3)*vdci_t)+(cmax*vj4));
}
else
{

d_qjci_dV_bi_ci = d_qjci_dV_tnode_GND = d_qjci_dV_b_ci =  0.0;
qjci = 0.0;
}
}
else
{
if ((cjci0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zci)));

d_vf_dV_tnode_GND = d_vdci_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdci_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ei = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_bi_ci = ((-d_Vbici_dV_bi_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbici)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci = d_xvf2_dV_bi_ei =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci = d_v_j_dV_bi_ei =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zci));
{
double value_log_0 = log((1.0-(v_j/vdci_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci = d_y_dV_ci_ei = d_y_dV_bi_ei =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdci_t)))))));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vdci_t*d_v_j_dV_tnode_GND-v_j*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))))+d_x_dV_tnode_GND*value_log_0))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vdci_t)))))));
y = (1.0-value_exp_1);
}

d_qjci_dV_b_ci = (((cjci0_t_ii*vdci_t)*d_y_dV_b_ci/x)+(2.4*cjci0_t_ii)*(-d_v_j_dV_b_ci));
d_qjci_dV_bi_ci = (((cjci0_t_ii*vdci_t)*d_y_dV_bi_ci/x)+(2.4*cjci0_t_ii)*(d_Vbici_dV_bi_ci-d_v_j_dV_bi_ci));
d_qjci_dV_tnode_GND = (((x*((cjci0_t_ii*vdci_t)*d_y_dV_tnode_GND+(cjci0_t_ii*d_vdci_t_dV_tnode_GND+d_cjci0_t_ii_dV_tnode_GND*vdci_t)*y)-((cjci0_t_ii*vdci_t)*y)*d_x_dV_tnode_GND)/x/x)+((2.4*cjci0_t_ii)*(-d_v_j_dV_tnode_GND)+2.4*d_cjci0_t_ii_dV_tnode_GND*(Vbici-v_j)));
qjci = ((((cjci0_t_ii*vdci_t)*y)/x)+((2.4*cjci0_t_ii)*(Vbici-v_j)));
}
else
{

d_qjci_dV_bi_ci = d_qjci_dV_tnode_GND = d_qjci_dV_b_ci =  0.0;
qjci = 0.00;
}
}

d_qjci_int_dV_b_ci = d_qjci_dV_b_ci;
d_qjci_int_dV_tnode_GND = d_qjci_dV_tnode_GND;
d_qjci_int_dV_bi_ci = d_qjci_dV_bi_ci;
qjci_int = qjci;

d_qjcii_dV_b_ci = (d_qjci_dV_b_ci+d_qjcxi_dV_b_ci);
d_qjcii_dV_tnode_GND = (d_qjci_dV_tnode_GND+d_qjcxi_dV_tnode_GND);
d_qjcii_dV_bi_ci = (d_qjci_dV_bi_ci+d_qjcxi_dV_bi_ci);
qjcii = (qjci+qjcxi);
if ((cjci0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zci)));

d_vf_dV_tnode_GND = d_vdci_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vdci_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ei = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_bi_ci = ((-d_Vbici_dV_bi_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbici)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci = d_xvf2_dV_bi_ei =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci = d_v_j_dV_bi_ei =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_dvj_dV_b_ci = ((xvf2*0.5*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)-(0.5*(xvf+xvf2))*d_xvf2_dV_b_ci)/xvf2/xvf2);
d_dvj_dV_tnode_GND = ((xvf2*0.5*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)-(0.5*(xvf+xvf2))*d_xvf2_dV_tnode_GND)/xvf2/xvf2);
d_dvj_dV_bi_ci = ((xvf2*0.5*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)-(0.5*(xvf+xvf2))*d_xvf2_dV_bi_ci)/xvf2/xvf2);
dvj = ((0.5*(xvf+xvf2))/xvf2);
{
double value_log_0 = log((1-(v_j/vdci_t)));
double value_exp_1 = exp(((-(model_.zci))*value_log_0));
double  deriv_log_0_d0 = (1.0/(1-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_cjcii_dV_b_ci = (((cjci0_t_ii*value_exp_1)*d_dvj_dV_b_ci+cjci0_t_ii*(deriv_exp_1_d0*((-(model_.zci))*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdci_t))))))*dvj)+(2.4*cjci0_t_ii)*(-d_dvj_dV_b_ci));
d_cjcii_dV_bi_ci = (((cjci0_t_ii*value_exp_1)*d_dvj_dV_bi_ci+cjci0_t_ii*(deriv_exp_1_d0*((-(model_.zci))*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vdci_t))))))*dvj)+(2.4*cjci0_t_ii)*(-d_dvj_dV_bi_ci));
d_cjcii_dV_tnode_GND = (((cjci0_t_ii*value_exp_1)*d_dvj_dV_tnode_GND+(cjci0_t_ii*(deriv_exp_1_d0*((-(model_.zci))*(deriv_log_0_d0*((-((vdci_t*d_v_j_dV_tnode_GND-v_j*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t))))))+d_cjci0_t_ii_dV_tnode_GND*value_exp_1)*dvj)+((2.4*cjci0_t_ii)*(-d_dvj_dV_tnode_GND)+2.4*d_cjci0_t_ii_dV_tnode_GND*(1-dvj)));
cjcii = (((cjci0_t_ii*value_exp_1)*dvj)+((2.4*cjci0_t_ii)*(1-dvj)));
}
}
else
{

d_cjcii_dV_tnode_GND = d_cjcii_dV_bi_ci = d_cjcii_dV_b_ci =  0.0;
cjcii = 0.0;
}

d_vc_dV_tnode_GND = (-d_vces_t_dV_tnode_GND);
d_vc_dV_ci_ei = d_Vciei_dV_ci_ei;
vc = (Vciei-vces_t);

d_uvc_dV_tnode_GND = ((VT*d_vc_dV_tnode_GND-vc*d_VT_dV_tnode_GND)/VT/VT);
d_uvc_dV_ci_ei = (d_vc_dV_ci_ei/VT);
uvc = ((vc/VT)-1);
{
double value_sqrt_0 = sqrt(((uvc*uvc)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_vceff_dV_ci_ei = VT*0.5*(d_uvc_dV_ci_ei+(deriv_sqrt_0_d0*((uvc*d_uvc_dV_ci_ei+d_uvc_dV_ci_ei*uvc))));
d_vceff_dV_tnode_GND = (VT*0.5*(d_uvc_dV_tnode_GND+(deriv_sqrt_0_d0*((uvc*d_uvc_dV_tnode_GND+d_uvc_dV_tnode_GND*uvc))))+d_VT_dV_tnode_GND*(1+(0.5*(uvc+value_sqrt_0))));
vceff = (VT*(1+(0.5*(uvc+value_sqrt_0))));
}

d_x_dV_ci_ei = (d_vceff_dV_ci_ei/(model_.vpt));
d_x_dV_tnode_GND = ((d_vceff_dV_tnode_GND-d_vlim_t_dV_tnode_GND)/(model_.vpt));
x = ((vceff-vlim_t)/(model_.vpt));
{
double value_sqrt_0 = sqrt(((x*x)+1e-3));
double value_sqrt_1 = sqrt((1+(((vceff*vceff)/vlim_t)/vlim_t)));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);

d_ick_dV_ci_ei = ((value_sqrt_1*((vceff*0.5*(d_x_dV_ci_ei+(deriv_sqrt_0_d0*((x*d_x_dV_ci_ei+d_x_dV_ci_ei*x))))+d_vceff_dV_ci_ei*(1+(0.5*(x+value_sqrt_0))))/rci0_t)-((vceff*(1+(0.5*(x+value_sqrt_0))))/rci0_t)*(deriv_sqrt_1_d0*((((vceff*d_vceff_dV_ci_ei+d_vceff_dV_ci_ei*vceff)/vlim_t)/vlim_t))))/value_sqrt_1/value_sqrt_1);
d_ick_dV_tnode_GND = ((value_sqrt_1*((rci0_t*(vceff*0.5*(d_x_dV_tnode_GND+(deriv_sqrt_0_d0*((x*d_x_dV_tnode_GND+d_x_dV_tnode_GND*x))))+d_vceff_dV_tnode_GND*(1+(0.5*(x+value_sqrt_0))))-(vceff*(1+(0.5*(x+value_sqrt_0))))*d_rci0_t_dV_tnode_GND)/rci0_t/rci0_t)-((vceff*(1+(0.5*(x+value_sqrt_0))))/rci0_t)*(deriv_sqrt_1_d0*(((vlim_t*((vlim_t*(vceff*d_vceff_dV_tnode_GND+d_vceff_dV_tnode_GND*vceff)-(vceff*vceff)*d_vlim_t_dV_tnode_GND)/vlim_t/vlim_t)-((vceff*vceff)/vlim_t)*d_vlim_t_dV_tnode_GND)/vlim_t/vlim_t))))/value_sqrt_1/value_sqrt_1);
ick = (((vceff*(1+(0.5*(x+value_sqrt_0))))/rci0_t)/value_sqrt_1);
}
if (((cjcii>0.0)&&(cjci0_t_ii>0.0)))
{

d_cc_dV_b_ci = (-cjci0_t_ii*d_cjcii_dV_b_ci/cjcii/cjcii);
d_cc_dV_bi_ci = (-cjci0_t_ii*d_cjcii_dV_bi_ci/cjcii/cjcii);
d_cc_dV_tnode_GND = ((cjcii*d_cjci0_t_ii_dV_tnode_GND-cjci0_t_ii*d_cjcii_dV_tnode_GND)/cjcii/cjcii);
cc = (cjci0_t_ii/cjcii);

d_qjci_dV_b_ci = (d_qjci_dV_b_ci/cjci0_t_ii);
d_qjci_dV_tnode_GND = ((cjci0_t_ii*d_qjci_dV_tnode_GND-qjci*d_cjci0_t_ii_dV_tnode_GND)/cjci0_t_ii/cjci0_t_ii);
d_qjci_dV_bi_ci = (d_qjci_dV_bi_ci/cjci0_t_ii);
qjci = (qjci/cjci0_t_ii);
}
else
{

d_cc_dV_tnode_GND = d_cc_dV_bi_ci = d_cc_dV_b_ci =  0.0;
cc = 1.0;

d_qjci_dV_bi_ci = d_qjci_dV_tnode_GND = d_qjci_dV_b_ci =  0.0;
qjci = 0;
}
if ((cje0_dc_t>0.0))
{
{
double value_log_0 = log(ajedc_t);
double value_exp_1 = exp(((-value_log_0)/(model_.zedc)));
double  deriv_log_0_d0 = (1.0/ajedc_t);
double  deriv_exp_1_d0 = value_exp_1;

d_vf_dV_tnode_GND = (vdedc_t*(-(deriv_exp_1_d0*(((-(deriv_log_0_d0*(d_ajedc_t_dV_tnode_GND)))/(model_.zedc)))))+d_vdedc_t_dV_tnode_GND*(1.0-value_exp_1));
vf = (vdedc_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ci = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_bi_ei = ((-d_Vbiei_dV_bi_ei)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbiei)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbiei)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
d_xvf2_dV_bi_ei = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ei+d_xvf_dV_bi_ei*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_bi_ei = (-VT*(d_xvf_dV_bi_ei+d_xvf2_dV_bi_ei)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zedc));
{
double value_log_0 = log((1.0-(v_j/vdedc_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdedc_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vdedc_t)))))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vdedc_t)))))));
d_y_dV_bi_ei = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ei/vdedc_t)))))));
d_y_dV_ci_ei = (-(deriv_exp_1_d0*(d_x_dV_ci_ei*value_log_0)));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vdedc_t*d_v_j_dV_tnode_GND-v_j*d_vdedc_t_dV_tnode_GND)/vdedc_t/vdedc_t))))+d_x_dV_tnode_GND*value_log_0))));
y = (1.0-value_exp_1);
}

d_qjei_dV_b_ci = (((cje0_dc_t*vdedc_t)*d_y_dV_b_ci/x)+(ajedc_t*cje0_dc_t)*(-d_v_j_dV_b_ci));
d_qjei_dV_bi_ci = (((cje0_dc_t*vdedc_t)*d_y_dV_bi_ci/x)+(ajedc_t*cje0_dc_t)*(-d_v_j_dV_bi_ci));
d_qjei_dV_bi_ei = (((cje0_dc_t*vdedc_t)*d_y_dV_bi_ei/x)+(ajedc_t*cje0_dc_t)*(d_Vbiei_dV_bi_ei-d_v_j_dV_bi_ei));
d_qjei_dV_ci_ei = ((x*(cje0_dc_t*vdedc_t)*d_y_dV_ci_ei-((cje0_dc_t*vdedc_t)*y)*d_x_dV_ci_ei)/x/x);
d_qjei_dV_tnode_GND = (((x*((cje0_dc_t*vdedc_t)*d_y_dV_tnode_GND+(cje0_dc_t*d_vdedc_t_dV_tnode_GND+d_cje0_dc_t_dV_tnode_GND*vdedc_t)*y)-((cje0_dc_t*vdedc_t)*y)*d_x_dV_tnode_GND)/x/x)+((ajedc_t*cje0_dc_t)*(-d_v_j_dV_tnode_GND)+(ajedc_t*d_cje0_dc_t_dV_tnode_GND+d_ajedc_t_dV_tnode_GND*cje0_dc_t)*(Vbiei-v_j)));
qjei = ((((cje0_dc_t*vdedc_t)*y)/x)+((ajedc_t*cje0_dc_t)*(Vbiei-v_j)));
}
else
{

d_qjei_dV_tnode_GND = d_qjei_dV_ci_ei = d_qjei_dV_bi_ei = d_qjei_dV_bi_ci = d_qjei_dV_b_ci =  0.0;
qjei = 0.00;
}
if (((model_.aver)==0.0))
{

d_h_vbe_dV_tnode_GND = d_h_vbe_dV_bi_ei =  0.0;
h_vbe = 1;
}
else
{

d_vjh_dV_bi_ei = ((-d_Vbiei_dV_bi_ei)/(2.0*VT));
d_vjh_dV_tnode_GND = (((2.0*VT)*d_vdedc_t_dV_tnode_GND-(vdedc_t-Vbiei)*2.0*d_VT_dV_tnode_GND)/(2.0*VT)/(2.0*VT));
vjh = ((vdedc_t-Vbiei)/(2.0*VT));
{
double value_sqrt_0 = sqrt(((vjh*vjh)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_vjh_dV_bi_ei = (-(2.0*VT)*(d_vjh_dV_bi_ei+(deriv_sqrt_0_d0*((vjh*d_vjh_dV_bi_ei+d_vjh_dV_bi_ei*vjh))))*0.5);
d_vjh_dV_tnode_GND = (d_vdedc_t_dV_tnode_GND-((2.0*VT)*(d_vjh_dV_tnode_GND+(deriv_sqrt_0_d0*((vjh*d_vjh_dV_tnode_GND+d_vjh_dV_tnode_GND*vjh))))+2.0*d_VT_dV_tnode_GND*(vjh+value_sqrt_0))*0.5);
vjh = (vdedc_t-(((2.0*VT)*(vjh+value_sqrt_0))*0.5));
}

d_vjh_dV_bi_ei = (d_vjh_dV_bi_ei/VT);
d_vjh_dV_tnode_GND = ((VT*(d_vjh_dV_tnode_GND-d_VT_dV_tnode_GND)-(vjh-VT)*d_VT_dV_tnode_GND)/VT/VT);
vjh = ((vjh-VT)/VT);
{
double value_sqrt_0 = sqrt(((vjh*vjh)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_vjh_dV_bi_ei = VT*(d_vjh_dV_bi_ei+(deriv_sqrt_0_d0*((vjh*d_vjh_dV_bi_ei+d_vjh_dV_bi_ei*vjh))))*0.5;
d_vjh_dV_tnode_GND = (VT*(d_vjh_dV_tnode_GND+(deriv_sqrt_0_d0*((vjh*d_vjh_dV_tnode_GND+d_vjh_dV_tnode_GND*vjh))))*0.5+d_VT_dV_tnode_GND*(1.0+((vjh+value_sqrt_0)*0.5)));
vjh = (VT*(1.0+((vjh+value_sqrt_0)*0.5)));
}
{
double value_log_0 = log((1.0-(vjh/vdedc_t)));
double value_exp_1 = exp(((model_.zedc)*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(vjh/vdedc_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_vj_z_dV_bi_ei = (-(deriv_exp_1_d0*((model_.zedc)*(deriv_log_0_d0*((-(d_vjh_dV_bi_ei/vdedc_t)))))))*aver_t;
d_vj_z_dV_tnode_GND = ((1.0-value_exp_1)*d_aver_t_dV_tnode_GND+(-(deriv_exp_1_d0*((model_.zedc)*(deriv_log_0_d0*((-((vdedc_t*d_vjh_dV_tnode_GND-vjh*d_vdedc_t_dV_tnode_GND)/vdedc_t/vdedc_t)))))))*aver_t);
vj_z = ((1.0-value_exp_1)*aver_t);
}
{
double value_exp_0 = exp(vj_z);
double  deriv_exp_0_d0 = value_exp_0;

d_h_vbe_dV_bi_ei = ((vj_z*(deriv_exp_0_d0*(d_vj_z_dV_bi_ei))-(value_exp_0-1.0)*d_vj_z_dV_bi_ei)/vj_z/vj_z);
d_h_vbe_dV_tnode_GND = ((vj_z*(deriv_exp_0_d0*(d_vj_z_dV_tnode_GND))-(value_exp_0-1.0)*d_vj_z_dV_tnode_GND)/vj_z/vj_z);
h_vbe = ((value_exp_0-1.0)/vj_z);
}
}

d_qje_dV_b_ci = (h_vbe*d_qjei_dV_b_ci/cje0_dc_t);
d_qje_dV_bi_ci = (h_vbe*d_qjei_dV_bi_ci/cje0_dc_t);
d_qje_dV_ci_ei = (h_vbe*d_qjei_dV_ci_ei/cje0_dc_t);
d_qje_dV_bi_ei = ((h_vbe*d_qjei_dV_bi_ei+d_h_vbe_dV_bi_ei*qjei)/cje0_dc_t);
d_qje_dV_tnode_GND = ((cje0_dc_t*(h_vbe*d_qjei_dV_tnode_GND+d_h_vbe_dV_tnode_GND*qjei)-(h_vbe*qjei)*d_cje0_dc_t_dV_tnode_GND)/cje0_dc_t/cje0_dc_t);
qje = ((h_vbe*qjei)/cje0_dc_t);

d_qj_dV_ci_ei = (d_qje_dV_ci_ei/ver_t);
d_qj_dV_bi_ei = (d_qje_dV_bi_ei/ver_t);
d_qj_dV_b_ci = ((d_qjci_dV_b_ci/(model_.vef))+(d_qje_dV_b_ci/ver_t));
d_qj_dV_tnode_GND = ((d_qjci_dV_tnode_GND/(model_.vef))+((ver_t*d_qje_dV_tnode_GND-qje*d_ver_t_dV_tnode_GND)/ver_t/ver_t));
d_qj_dV_bi_ci = ((d_qjci_dV_bi_ci/(model_.vef))+(d_qje_dV_bi_ci/ver_t));
qj = ((1+(qjci/(model_.vef)))+(qje/ver_t));

d_b_q_dV_ci_ei = 20*d_qj_dV_ci_ei;
d_b_q_dV_bi_ei = 20*d_qj_dV_bi_ei;
d_b_q_dV_b_ci = 20*d_qj_dV_b_ci;
d_b_q_dV_tnode_GND = 20*d_qj_dV_tnode_GND;
d_b_q_dV_bi_ci = 20*d_qj_dV_bi_ci;
b_q = ((20*qj)-1);
{
double value_sqrt_0 = sqrt(((b_q*b_q)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_qj_2_dV_ci_ei = 0.025*((d_b_q_dV_ci_ei+(deriv_sqrt_0_d0*((b_q*d_b_q_dV_ci_ei+d_b_q_dV_ci_ei*b_q))))/2);
d_qj_2_dV_bi_ei = 0.025*((d_b_q_dV_bi_ei+(deriv_sqrt_0_d0*((b_q*d_b_q_dV_bi_ei+d_b_q_dV_bi_ei*b_q))))/2);
d_qj_2_dV_b_ci = 0.025*((d_b_q_dV_b_ci+(deriv_sqrt_0_d0*((b_q*d_b_q_dV_b_ci+d_b_q_dV_b_ci*b_q))))/2);
d_qj_2_dV_tnode_GND = 0.025*((d_b_q_dV_tnode_GND+(deriv_sqrt_0_d0*((b_q*d_b_q_dV_tnode_GND+d_b_q_dV_tnode_GND*b_q))))/2);
d_qj_2_dV_bi_ci = 0.025*((d_b_q_dV_bi_ci+(deriv_sqrt_0_d0*((b_q*d_b_q_dV_bi_ci+d_b_q_dV_bi_ci*b_q))))/2);
qj_2 = (0.025*(1+((b_q+value_sqrt_0)/2)));
}

d_tf0_dV_b_ci = ((model_.dt0h)*d_cc_dV_b_ci+(model_.tbvl)*(-1*d_cc_dV_b_ci/cc/cc));
d_tf0_dV_bi_ci = ((model_.dt0h)*d_cc_dV_bi_ci+(model_.tbvl)*(-1*d_cc_dV_bi_ci/cc/cc));
d_tf0_dV_tnode_GND = ((d_t0_t_dV_tnode_GND+(model_.dt0h)*d_cc_dV_tnode_GND)+(model_.tbvl)*(-1*d_cc_dV_tnode_GND/cc/cc));
tf0 = ((t0_t+((model_.dt0h)*(cc-1)))+((model_.tbvl)*((1/cc)-1)));
if (((model_.fiqf)==1))
{

d_denom_iqf_dV_b_ci = (model_.fiqf)*(d_tf0_dV_b_ci/t0_t);
d_denom_iqf_dV_bi_ci = (model_.fiqf)*(d_tf0_dV_bi_ci/t0_t);
d_denom_iqf_dV_tnode_GND = (model_.fiqf)*((t0_t*d_tf0_dV_tnode_GND-tf0*d_t0_t_dV_tnode_GND)/t0_t/t0_t);
denom_iqf = ((model_.fiqf)*((tf0/t0_t)-1));

d_ickf_dV_b_ci = (-iqf_t*d_denom_iqf_dV_b_ci/(1+denom_iqf)/(1+denom_iqf));
d_ickf_dV_bi_ci = (-iqf_t*d_denom_iqf_dV_bi_ci/(1+denom_iqf)/(1+denom_iqf));
d_ickf_dV_tnode_GND = (((1+denom_iqf)*d_iqf_t_dV_tnode_GND-iqf_t*d_denom_iqf_dV_tnode_GND)/(1+denom_iqf)/(1+denom_iqf));
ickf = (iqf_t/(1+denom_iqf));
}
else
{

d_ickf_dV_bi_ci = d_ickf_dV_b_ci =  0.0;
d_ickf_dV_tnode_GND = d_iqf_t_dV_tnode_GND;
ickf = iqf_t;
}
ickr = (model_.iqr);

d_arg1_dV_tnode_GND = (-Vbiei*(model_.mcf)*d_VT_dV_tnode_GND/((model_.mcf)*VT)/((model_.mcf)*VT));
d_arg1_dV_bi_ei = (d_Vbiei_dV_bi_ei/((model_.mcf)*VT));
arg1 = (Vbiei/((model_.mcf)*VT));
if ((arg1>80))
{

d_le1_dV_tnode_GND = d_arg1_dV_tnode_GND;
d_le1_dV_bi_ei = d_arg1_dV_bi_ei;
le1 = (1+(arg1-80));

d_arg1_dV_bi_ei = d_arg1_dV_tnode_GND =  0.0;
arg1 = 80;
}
else
{

d_le1_dV_bi_ei = d_le1_dV_tnode_GND =  0.0;
le1 = 1;
}
{
double value_limexp_0 = limexp(arg1);
double  deriv_limexp_0_d0 = (((arg1)<80)?(value_limexp_0):exp(80.0));

d_le1_dV_tnode_GND = (le1*(deriv_limexp_0_d0*(d_arg1_dV_tnode_GND))+d_le1_dV_tnode_GND*value_limexp_0);
d_le1_dV_bi_ei = (le1*(deriv_limexp_0_d0*(d_arg1_dV_bi_ei))+d_le1_dV_bi_ei*value_limexp_0);
le1 = (le1*value_limexp_0);
}

d_itfi_dV_bi_ei = is_t*d_le1_dV_bi_ei;
d_itfi_dV_tnode_GND = (is_t*d_le1_dV_tnode_GND+d_is_t_dV_tnode_GND*le1);
itfi = (is_t*le1);

d_arg2_dV_tnode_GND = (-Vbici*(model_.mcr)*d_VT_dV_tnode_GND/((model_.mcr)*VT)/((model_.mcr)*VT));
d_arg2_dV_bi_ci = (d_Vbici_dV_bi_ci/((model_.mcr)*VT));
arg2 = (Vbici/((model_.mcr)*VT));
if ((arg2>80))
{

d_le2_dV_tnode_GND = d_arg2_dV_tnode_GND;
d_le2_dV_bi_ci = d_arg2_dV_bi_ci;
le2 = (1+(arg2-80));

d_arg2_dV_bi_ci = d_arg2_dV_tnode_GND =  0.0;
arg2 = 80;
}
else
{

d_le2_dV_bi_ci = d_le2_dV_tnode_GND =  0.0;
le2 = 1;
}
{
double value_limexp_0 = limexp(arg2);
double  deriv_limexp_0_d0 = (((arg2)<80)?(value_limexp_0):exp(80.0));

d_le2_dV_tnode_GND = (le2*(deriv_limexp_0_d0*(d_arg2_dV_tnode_GND))+d_le2_dV_tnode_GND*value_limexp_0);
d_le2_dV_bi_ci = (le2*(deriv_limexp_0_d0*(d_arg2_dV_bi_ci))+d_le2_dV_bi_ci*value_limexp_0);
le2 = (le2*value_limexp_0);
}

d_itri_dV_bi_ci = is_t*d_le2_dV_bi_ci;
d_itri_dV_tnode_GND = (is_t*d_le2_dV_tnode_GND+d_is_t_dV_tnode_GND*le2);
itri = (is_t*le2);
if (((model_.tfh)!=0))
{
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_qml_dV_ci_ei = (deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(itfi*(-itfi*d_ick_dV_ci_ei/ick/ick)*(tfh_t/iqfh_t)))));
d_qml_dV_b_ci = (-itfi*d_ickf_dV_b_ci/ickf/ickf);
d_qml_dV_bi_ci = ((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr));
d_qml_dV_bi_ei = ((d_itfi_dV_bi_ei/ickf)+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*((itfi*(d_itfi_dV_bi_ei/ick)+d_itfi_dV_bi_ei*(itfi/ick))*(tfh_t/iqfh_t))))));
d_qml_dV_tnode_GND = ((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dV_tnode_GND-tfh_t*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dV_tnode_GND-itfi*d_ick_dV_tnode_GND)/ick/ick)+d_itfi_dV_tnode_GND*(itfi/ick))*(tfh_t/iqfh_t)))))));
qml = (((itfi/ickf)+(itri/ickr))+value_exp_1);
}
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_qmh_dV_ci_ei = (deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(itfi*(-itfi*d_ick_dV_ci_ei/ick/ick)*(tfh_t/iqfh_t)))));
d_qmh_dV_b_ci = (-itfi*d_ickf_dV_b_ci/ickf/ickf);
d_qmh_dV_bi_ci = ((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr));
d_qmh_dV_bi_ei = (((d_itfi_dV_bi_ei/ickf)+(d_itfi_dV_bi_ei/iqfh_t))+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*((itfi*(d_itfi_dV_bi_ei/ick)+d_itfi_dV_bi_ei*(itfi/ick))*(tfh_t/iqfh_t))))));
d_qmh_dV_tnode_GND = (((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+((iqfh_t*d_itfi_dV_tnode_GND-itfi*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t))+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dV_tnode_GND-tfh_t*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dV_tnode_GND-itfi*d_ick_dV_tnode_GND)/ick/ick)+d_itfi_dV_tnode_GND*(itfi/ick))*(tfh_t/iqfh_t)))))));
qmh = ((((itfi/ickf)+(itri/ickr))+(itfi/iqfh_t))+value_exp_1);
}
}
else
{

d_qml_dV_ci_ei =  0.0;
d_qml_dV_b_ci = (-itfi*d_ickf_dV_b_ci/ickf/ickf);
d_qml_dV_bi_ci = ((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr));
d_qml_dV_bi_ei = (d_itfi_dV_bi_ei/ickf);
d_qml_dV_tnode_GND = (((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr));
qml = ((itfi/ickf)+(itri/ickr));

d_qmh_dV_ci_ei =  0.0;
d_qmh_dV_b_ci = (-itfi*d_ickf_dV_b_ci/ickf/ickf);
d_qmh_dV_bi_ci = ((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr));
d_qmh_dV_bi_ei = ((d_itfi_dV_bi_ei/ickf)+(d_itfi_dV_bi_ei/iqfh_t));
d_qmh_dV_tnode_GND = ((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+((iqfh_t*d_itfi_dV_tnode_GND-itfi*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t));
qmh = (((itfi/ickf)+(itri/ickr))+(itfi/iqfh_t));
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qml));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_qpt_l_dV_ci_ei = (d_qj_2_dV_ci_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_ci_ei+d_qj_2_dV_ci_ei*qj_2)+d_qml_dV_ci_ei))));
d_qpt_l_dV_bi_ei = (d_qj_2_dV_bi_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ei+d_qj_2_dV_bi_ei*qj_2)+d_qml_dV_bi_ei))));
d_qpt_l_dV_b_ci = (d_qj_2_dV_b_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_b_ci+d_qj_2_dV_b_ci*qj_2)+d_qml_dV_b_ci))));
d_qpt_l_dV_tnode_GND = (d_qj_2_dV_tnode_GND+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_tnode_GND+d_qj_2_dV_tnode_GND*qj_2)+d_qml_dV_tnode_GND))));
d_qpt_l_dV_bi_ci = (d_qj_2_dV_bi_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ci+d_qj_2_dV_bi_ci*qj_2)+d_qml_dV_bi_ci))));
qpt_l = (qj_2+value_sqrt_0);
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qmh));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_qpt_h_dV_ci_ei = (d_qj_2_dV_ci_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_ci_ei+d_qj_2_dV_ci_ei*qj_2)+d_qmh_dV_ci_ei))));
d_qpt_h_dV_bi_ei = (d_qj_2_dV_bi_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ei+d_qj_2_dV_bi_ei*qj_2)+d_qmh_dV_bi_ei))));
d_qpt_h_dV_b_ci = (d_qj_2_dV_b_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_b_ci+d_qj_2_dV_b_ci*qj_2)+d_qmh_dV_b_ci))));
d_qpt_h_dV_tnode_GND = (d_qj_2_dV_tnode_GND+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_tnode_GND+d_qj_2_dV_tnode_GND*qj_2)+d_qmh_dV_tnode_GND))));
d_qpt_h_dV_bi_ci = (d_qj_2_dV_bi_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ci+d_qj_2_dV_bi_ci*qj_2)+d_qmh_dV_bi_ci))));
qpt_h = (qj_2+value_sqrt_0);
}

d_diff_q_dV_ci_ei = (d_qmh_dV_ci_ei-d_qml_dV_ci_ei);
d_diff_q_dV_b_ci = (d_qmh_dV_b_ci-d_qml_dV_b_ci);
d_diff_q_dV_bi_ci = (d_qmh_dV_bi_ci-d_qml_dV_bi_ci);
d_diff_q_dV_bi_ei = (d_qmh_dV_bi_ei-d_qml_dV_bi_ei);
d_diff_q_dV_tnode_GND = (d_qmh_dV_tnode_GND-d_qml_dV_tnode_GND);
diff_q = (qmh-qml);
if ((fabs(diff_q)>1e-8))
{

d_a1_dV_b_ci = (-((ick/(1+ahq_t))/itfi)*d_qpt_l_dV_b_ci);
d_a1_dV_bi_ci = (-((ick/(1+ahq_t))/itfi)*d_qpt_l_dV_bi_ci);
d_a1_dV_bi_ei = (-(((ick/(1+ahq_t))/itfi)*d_qpt_l_dV_bi_ei+(-(ick/(1+ahq_t))*d_itfi_dV_bi_ei/itfi/itfi)*qpt_l));
d_a1_dV_ci_ei = (-(((ick/(1+ahq_t))/itfi)*d_qpt_l_dV_ci_ei+((d_ick_dV_ci_ei/(1+ahq_t))/itfi)*qpt_l));
d_a1_dV_tnode_GND = (-(((ick/(1+ahq_t))/itfi)*d_qpt_l_dV_tnode_GND+((itfi*(d_ick_dV_tnode_GND/(1+ahq_t))-(ick/(1+ahq_t))*d_itfi_dV_tnode_GND)/itfi/itfi)*qpt_l));
a1 = (1-(((ick/(1+ahq_t))/itfi)*qpt_l));

d_a2_dV_b_ci = ((ick/(1+ahq_t))/itfi)*(d_qpt_h_dV_b_ci-d_qpt_l_dV_b_ci);
d_a2_dV_bi_ci = ((ick/(1+ahq_t))/itfi)*(d_qpt_h_dV_bi_ci-d_qpt_l_dV_bi_ci);
d_a2_dV_bi_ei = (((ick/(1+ahq_t))/itfi)*(d_qpt_h_dV_bi_ei-d_qpt_l_dV_bi_ei)+(-(ick/(1+ahq_t))*d_itfi_dV_bi_ei/itfi/itfi)*(qpt_h-qpt_l));
d_a2_dV_ci_ei = (((ick/(1+ahq_t))/itfi)*(d_qpt_h_dV_ci_ei-d_qpt_l_dV_ci_ei)+((d_ick_dV_ci_ei/(1+ahq_t))/itfi)*(qpt_h-qpt_l));
d_a2_dV_tnode_GND = (((ick/(1+ahq_t))/itfi)*(d_qpt_h_dV_tnode_GND-d_qpt_l_dV_tnode_GND)+((itfi*(d_ick_dV_tnode_GND/(1+ahq_t))-(ick/(1+ahq_t))*d_itfi_dV_tnode_GND)/itfi/itfi)*(qpt_h-qpt_l));
a2 = (1+(((ick/(1+ahq_t))/itfi)*(qpt_h-qpt_l)));

d_aa_dV_b_ci = ((a2*d_a1_dV_b_ci-a1*d_a2_dV_b_ci)/a2/a2);
d_aa_dV_bi_ci = ((a2*d_a1_dV_bi_ci-a1*d_a2_dV_bi_ci)/a2/a2);
d_aa_dV_bi_ei = ((a2*d_a1_dV_bi_ei-a1*d_a2_dV_bi_ei)/a2/a2);
d_aa_dV_ci_ei = ((a2*d_a1_dV_ci_ei-a1*d_a2_dV_ci_ei)/a2/a2);
d_aa_dV_tnode_GND = ((a2*d_a1_dV_tnode_GND-a1*d_a2_dV_tnode_GND)/a2/a2);
aa = (a1/a2);
{
double value_sqrt_0 = sqrt(((aa*aa)+0.01));
double value_sqrt_1 = sqrt((1+0.01));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_wdc_dV_b_ci = (((deriv_sqrt_0_d0*((aa*d_aa_dV_b_ci+d_aa_dV_b_ci*aa)))+d_aa_dV_b_ci)/(1+value_sqrt_1));
d_wdc_dV_bi_ci = (((deriv_sqrt_0_d0*((aa*d_aa_dV_bi_ci+d_aa_dV_bi_ci*aa)))+d_aa_dV_bi_ci)/(1+value_sqrt_1));
d_wdc_dV_bi_ei = (((deriv_sqrt_0_d0*((aa*d_aa_dV_bi_ei+d_aa_dV_bi_ei*aa)))+d_aa_dV_bi_ei)/(1+value_sqrt_1));
d_wdc_dV_ci_ei = (((deriv_sqrt_0_d0*((aa*d_aa_dV_ci_ei+d_aa_dV_ci_ei*aa)))+d_aa_dV_ci_ei)/(1+value_sqrt_1));
d_wdc_dV_tnode_GND = (((deriv_sqrt_0_d0*((aa*d_aa_dV_tnode_GND+d_aa_dV_tnode_GND*aa)))+d_aa_dV_tnode_GND)/(1+value_sqrt_1));
wdc = ((value_sqrt_0+aa)/(1+value_sqrt_1));
}
}
else
{

d_wdc_dV_tnode_GND = d_wdc_dV_ci_ei = d_wdc_dV_bi_ei = d_wdc_dV_bi_ci = d_wdc_dV_b_ci =  0.0;
wdc = 0;
}
if (((model_.it_mod)==0))
{
if (((model_.tfh)!=0))
{
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_qm_dV_ci_ei = ((((itfi/iqfh_t)*wdc)*d_wdc_dV_ci_ei+(itfi/iqfh_t)*d_wdc_dV_ci_ei*wdc)+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(itfi*(-itfi*d_ick_dV_ci_ei/ick/ick)*(tfh_t/iqfh_t))))));
d_qm_dV_b_ci = ((-itfi*d_ickf_dV_b_ci/ickf/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_b_ci+(itfi/iqfh_t)*d_wdc_dV_b_ci*wdc));
d_qm_dV_bi_ci = (((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ci+(itfi/iqfh_t)*d_wdc_dV_bi_ci*wdc));
d_qm_dV_bi_ei = (((d_itfi_dV_bi_ei/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ei+((itfi/iqfh_t)*d_wdc_dV_bi_ei+(d_itfi_dV_bi_ei/iqfh_t)*wdc)*wdc))+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*((itfi*(d_itfi_dV_bi_ei/ick)+d_itfi_dV_bi_ei*(itfi/ick))*(tfh_t/iqfh_t))))));
d_qm_dV_tnode_GND = (((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_tnode_GND+((itfi/iqfh_t)*d_wdc_dV_tnode_GND+((iqfh_t*d_itfi_dV_tnode_GND-itfi*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)*wdc)*wdc))+(deriv_exp_1_d0*(0.6666*(deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dV_tnode_GND-tfh_t*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dV_tnode_GND-itfi*d_ick_dV_tnode_GND)/ick/ick)+d_itfi_dV_tnode_GND*(itfi/ick))*(tfh_t/iqfh_t)))))));
qm = ((((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc))+value_exp_1);
}
}
else
{

d_qm_dV_ci_ei = (((itfi/iqfh_t)*wdc)*d_wdc_dV_ci_ei+(itfi/iqfh_t)*d_wdc_dV_ci_ei*wdc);
d_qm_dV_b_ci = ((-itfi*d_ickf_dV_b_ci/ickf/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_b_ci+(itfi/iqfh_t)*d_wdc_dV_b_ci*wdc));
d_qm_dV_bi_ci = (((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ci+(itfi/iqfh_t)*d_wdc_dV_bi_ci*wdc));
d_qm_dV_bi_ei = ((d_itfi_dV_bi_ei/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ei+((itfi/iqfh_t)*d_wdc_dV_bi_ei+(d_itfi_dV_bi_ei/iqfh_t)*wdc)*wdc));
d_qm_dV_tnode_GND = ((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_tnode_GND+((itfi/iqfh_t)*d_wdc_dV_tnode_GND+((iqfh_t*d_itfi_dV_tnode_GND-itfi*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)*wdc)*wdc));
qm = (((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc));
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qm));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_qpt_dV_ci_ei = (d_qj_2_dV_ci_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_ci_ei+d_qj_2_dV_ci_ei*qj_2)+d_qm_dV_ci_ei))));
d_qpt_dV_bi_ei = (d_qj_2_dV_bi_ei+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ei+d_qj_2_dV_bi_ei*qj_2)+d_qm_dV_bi_ei))));
d_qpt_dV_b_ci = (d_qj_2_dV_b_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_b_ci+d_qj_2_dV_b_ci*qj_2)+d_qm_dV_b_ci))));
d_qpt_dV_tnode_GND = (d_qj_2_dV_tnode_GND+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_tnode_GND+d_qj_2_dV_tnode_GND*qj_2)+d_qm_dV_tnode_GND))));
d_qpt_dV_bi_ci = (d_qj_2_dV_bi_ci+(deriv_sqrt_0_d0*(((qj_2*d_qj_2_dV_bi_ci+d_qj_2_dV_bi_ci*qj_2)+d_qm_dV_bi_ci))));
qpt = (qj_2+value_sqrt_0);
}
}
else
{
o3 = (1.0/3);

d_p2_a_dV_ci_ei = (-2)*d_qj_2_dV_ci_ei;
d_p2_a_dV_bi_ei = (-2)*d_qj_2_dV_bi_ei;
d_p2_a_dV_b_ci = (-2)*d_qj_2_dV_b_ci;
d_p2_a_dV_tnode_GND = (-2)*d_qj_2_dV_tnode_GND;
d_p2_a_dV_bi_ci = (-2)*d_qj_2_dV_bi_ci;
p2_a = ((-2)*qj_2);
if ((((model_.iqf)==1.0e6)&&((model_.iqfh)==1.0e6)))
{

d_p2_b_dV_tnode_GND = d_p2_b_dV_bi_ei = d_p2_b_dV_bi_ci = d_p2_b_dV_b_ci = d_p2_b_dV_ci_ei =  0.0;
p2_b = 0;
}
else
{

d_p2_b_dV_ci_ei = (-(((itfi/iqfh_t)*wdc)*d_wdc_dV_ci_ei+(itfi/iqfh_t)*d_wdc_dV_ci_ei*wdc));
d_p2_b_dV_b_ci = (-((-itfi*d_ickf_dV_b_ci/ickf/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_b_ci+(itfi/iqfh_t)*d_wdc_dV_b_ci*wdc)));
d_p2_b_dV_bi_ci = (-(((-itfi*d_ickf_dV_bi_ci/ickf/ickf)+(d_itri_dV_bi_ci/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ci+(itfi/iqfh_t)*d_wdc_dV_bi_ci*wdc)));
d_p2_b_dV_bi_ei = (-((d_itfi_dV_bi_ei/ickf)+(((itfi/iqfh_t)*wdc)*d_wdc_dV_bi_ei+((itfi/iqfh_t)*d_wdc_dV_bi_ei+(d_itfi_dV_bi_ei/iqfh_t)*wdc)*wdc)));
d_p2_b_dV_tnode_GND = (-((((ickf*d_itfi_dV_tnode_GND-itfi*d_ickf_dV_tnode_GND)/ickf/ickf)+(d_itri_dV_tnode_GND/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dV_tnode_GND+((itfi/iqfh_t)*d_wdc_dV_tnode_GND+((iqfh_t*d_itfi_dV_tnode_GND-itfi*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t)*wdc)*wdc)));
p2_b = (-(((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc)));
}

d_p2_c_dV_ci_ei = ((-((-itfi)*itfi)*d_ick_dV_ci_ei/ick/ick)*tfh_t/iqfh_t);
d_p2_c_dV_bi_ei = ((((-itfi)*d_itfi_dV_bi_ei+(-d_itfi_dV_bi_ei)*itfi)/ick)*tfh_t/iqfh_t);
d_p2_c_dV_tnode_GND = ((iqfh_t*((((-itfi)*itfi)/ick)*d_tfh_t_dV_tnode_GND+((ick*((-itfi)*d_itfi_dV_tnode_GND+(-d_itfi_dV_tnode_GND)*itfi)-((-itfi)*itfi)*d_ick_dV_tnode_GND)/ick/ick)*tfh_t)-((((-itfi)*itfi)/ick)*tfh_t)*d_iqfh_t_dV_tnode_GND)/iqfh_t/iqfh_t);
p2_c = (((((-itfi)*itfi)/ick)*tfh_t)/iqfh_t);

d_tmp_dV_ci_ei = (p2_a*d_p2_a_dV_ci_ei+d_p2_a_dV_ci_ei*p2_a);
d_tmp_dV_bi_ei = (p2_a*d_p2_a_dV_bi_ei+d_p2_a_dV_bi_ei*p2_a);
d_tmp_dV_b_ci = (p2_a*d_p2_a_dV_b_ci+d_p2_a_dV_b_ci*p2_a);
d_tmp_dV_tnode_GND = (p2_a*d_p2_a_dV_tnode_GND+d_p2_a_dV_tnode_GND*p2_a);
d_tmp_dV_bi_ci = (p2_a*d_p2_a_dV_bi_ci+d_p2_a_dV_bi_ci*p2_a);
tmp = (p2_a*p2_a);

d_p2_p_dV_ci_ei = (d_p2_b_dV_ci_ei-d_tmp_dV_ci_ei*o3);
d_p2_p_dV_b_ci = (d_p2_b_dV_b_ci-d_tmp_dV_b_ci*o3);
d_p2_p_dV_bi_ci = (d_p2_b_dV_bi_ci-d_tmp_dV_bi_ci*o3);
d_p2_p_dV_bi_ei = (d_p2_b_dV_bi_ei-d_tmp_dV_bi_ei*o3);
d_p2_p_dV_tnode_GND = (d_p2_b_dV_tnode_GND-d_tmp_dV_tnode_GND*o3);
p2_p = (p2_b-(tmp*o3));

d_p2_q_dV_ci_ei = (((((2*p2_a)*d_tmp_dV_ci_ei+2*d_p2_a_dV_ci_ei*tmp)/27)-(p2_a*d_p2_b_dV_ci_ei+d_p2_a_dV_ci_ei*p2_b)*o3)+d_p2_c_dV_ci_ei);
d_p2_q_dV_bi_ei = (((((2*p2_a)*d_tmp_dV_bi_ei+2*d_p2_a_dV_bi_ei*tmp)/27)-(p2_a*d_p2_b_dV_bi_ei+d_p2_a_dV_bi_ei*p2_b)*o3)+d_p2_c_dV_bi_ei);
d_p2_q_dV_b_ci = ((((2*p2_a)*d_tmp_dV_b_ci+2*d_p2_a_dV_b_ci*tmp)/27)-(p2_a*d_p2_b_dV_b_ci+d_p2_a_dV_b_ci*p2_b)*o3);
d_p2_q_dV_tnode_GND = (((((2*p2_a)*d_tmp_dV_tnode_GND+2*d_p2_a_dV_tnode_GND*tmp)/27)-(p2_a*d_p2_b_dV_tnode_GND+d_p2_a_dV_tnode_GND*p2_b)*o3)+d_p2_c_dV_tnode_GND);
d_p2_q_dV_bi_ci = ((((2*p2_a)*d_tmp_dV_bi_ci+2*d_p2_a_dV_bi_ci*tmp)/27)-(p2_a*d_p2_b_dV_bi_ci+d_p2_a_dV_bi_ci*p2_b)*o3);
p2_q = (((((2*p2_a)*tmp)/27)-((p2_a*p2_b)*o3))+p2_c);

d_p2_D_dV_ci_ei = ((p2_q*d_p2_q_dV_ci_ei+d_p2_q_dV_ci_ei*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dV_ci_ei+(p2_p*d_p2_p_dV_ci_ei+d_p2_p_dV_ci_ei*p2_p)*p2_p)/27));
d_p2_D_dV_bi_ei = ((p2_q*d_p2_q_dV_bi_ei+d_p2_q_dV_bi_ei*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dV_bi_ei+(p2_p*d_p2_p_dV_bi_ei+d_p2_p_dV_bi_ei*p2_p)*p2_p)/27));
d_p2_D_dV_b_ci = ((p2_q*d_p2_q_dV_b_ci+d_p2_q_dV_b_ci*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dV_b_ci+(p2_p*d_p2_p_dV_b_ci+d_p2_p_dV_b_ci*p2_p)*p2_p)/27));
d_p2_D_dV_tnode_GND = ((p2_q*d_p2_q_dV_tnode_GND+d_p2_q_dV_tnode_GND*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dV_tnode_GND+(p2_p*d_p2_p_dV_tnode_GND+d_p2_p_dV_tnode_GND*p2_p)*p2_p)/27));
d_p2_D_dV_bi_ci = ((p2_q*d_p2_q_dV_bi_ci+d_p2_q_dV_bi_ci*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dV_bi_ci+(p2_p*d_p2_p_dV_bi_ci+d_p2_p_dV_bi_ci*p2_p)*p2_p)/27));
p2_D = (((p2_q*p2_q)*0.25)+(((p2_p*p2_p)*p2_p)/27));
if ((fabs(p2_D)<1e-10))
{

d_q_p3_dV_ci_ei = (((p2_p*3*d_p2_q_dV_ci_ei-(3*p2_q)*d_p2_p_dV_ci_ei)/p2_p/p2_p)-d_p2_a_dV_ci_ei*o3);
d_q_p3_dV_bi_ei = (((p2_p*3*d_p2_q_dV_bi_ei-(3*p2_q)*d_p2_p_dV_bi_ei)/p2_p/p2_p)-d_p2_a_dV_bi_ei*o3);
d_q_p3_dV_b_ci = (((p2_p*3*d_p2_q_dV_b_ci-(3*p2_q)*d_p2_p_dV_b_ci)/p2_p/p2_p)-d_p2_a_dV_b_ci*o3);
d_q_p3_dV_tnode_GND = (((p2_p*3*d_p2_q_dV_tnode_GND-(3*p2_q)*d_p2_p_dV_tnode_GND)/p2_p/p2_p)-d_p2_a_dV_tnode_GND*o3);
d_q_p3_dV_bi_ci = (((p2_p*3*d_p2_q_dV_bi_ci-(3*p2_q)*d_p2_p_dV_bi_ci)/p2_p/p2_p)-d_p2_a_dV_bi_ci*o3);
q_p3 = (((3*p2_q)/p2_p)-(p2_a*o3));
}
else
{
if ((p2_D>0))
{

d_tmp2_dV_ci_ei = (-d_p2_q_dV_ci_ei)*0.5;
d_tmp2_dV_bi_ei = (-d_p2_q_dV_bi_ei)*0.5;
d_tmp2_dV_b_ci = (-d_p2_q_dV_b_ci)*0.5;
d_tmp2_dV_tnode_GND = (-d_p2_q_dV_tnode_GND)*0.5;
d_tmp2_dV_bi_ci = (-d_p2_q_dV_bi_ci)*0.5;
tmp2 = ((-p2_q)*0.5);
{
double value_sqrt_0 = sqrt(p2_D);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_tmp3_dV_ci_ei = (deriv_sqrt_0_d0*(d_p2_D_dV_ci_ei));
d_tmp3_dV_bi_ei = (deriv_sqrt_0_d0*(d_p2_D_dV_bi_ei));
d_tmp3_dV_b_ci = (deriv_sqrt_0_d0*(d_p2_D_dV_b_ci));
d_tmp3_dV_tnode_GND = (deriv_sqrt_0_d0*(d_p2_D_dV_tnode_GND));
d_tmp3_dV_bi_ci = (deriv_sqrt_0_d0*(d_p2_D_dV_bi_ci));
tmp3 = value_sqrt_0;
}

d_tmp_dV_ci_ei = (d_tmp2_dV_ci_ei+d_tmp3_dV_ci_ei);
d_tmp_dV_bi_ei = (d_tmp2_dV_bi_ei+d_tmp3_dV_bi_ei);
d_tmp_dV_b_ci = (d_tmp2_dV_b_ci+d_tmp3_dV_b_ci);
d_tmp_dV_tnode_GND = (d_tmp2_dV_tnode_GND+d_tmp3_dV_tnode_GND);
d_tmp_dV_bi_ci = (d_tmp2_dV_bi_ci+d_tmp3_dV_bi_ci);
tmp = (tmp2+tmp3);
if ((tmp>0))
{
{
double value_log_0 = log(tmp);
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/tmp);
double  deriv_exp_1_d0 = value_exp_1;

d_p2_u_dV_ci_ei = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_ci_ei))));
d_p2_u_dV_bi_ei = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_bi_ei))));
d_p2_u_dV_b_ci = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_b_ci))));
d_p2_u_dV_tnode_GND = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_tnode_GND))));
d_p2_u_dV_bi_ci = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_bi_ci))));
p2_u = value_exp_1;
}
}
else
{
{
double value_log_0 = log((-tmp));
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/(-tmp));
double  deriv_exp_1_d0 = value_exp_1;

d_p2_u_dV_ci_ei = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_ci_ei))))));
d_p2_u_dV_bi_ei = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_bi_ei))))));
d_p2_u_dV_b_ci = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_b_ci))))));
d_p2_u_dV_tnode_GND = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_tnode_GND))))));
d_p2_u_dV_bi_ci = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_bi_ci))))));
p2_u = (-value_exp_1);
}
}

d_tmp_dV_ci_ei = (d_tmp2_dV_ci_ei-d_tmp3_dV_ci_ei);
d_tmp_dV_bi_ei = (d_tmp2_dV_bi_ei-d_tmp3_dV_bi_ei);
d_tmp_dV_b_ci = (d_tmp2_dV_b_ci-d_tmp3_dV_b_ci);
d_tmp_dV_tnode_GND = (d_tmp2_dV_tnode_GND-d_tmp3_dV_tnode_GND);
d_tmp_dV_bi_ci = (d_tmp2_dV_bi_ci-d_tmp3_dV_bi_ci);
tmp = (tmp2-tmp3);
if ((tmp>0))
{
{
double value_log_0 = log(tmp);
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/tmp);
double  deriv_exp_1_d0 = value_exp_1;

d_p2_v_dV_ci_ei = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_ci_ei))));
d_p2_v_dV_bi_ei = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_bi_ei))));
d_p2_v_dV_b_ci = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_b_ci))));
d_p2_v_dV_tnode_GND = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_tnode_GND))));
d_p2_v_dV_bi_ci = (deriv_exp_1_d0*(o3*(deriv_log_0_d0*(d_tmp_dV_bi_ci))));
p2_v = value_exp_1;
}
}
else
{
{
double value_log_0 = log((-tmp));
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/(-tmp));
double  deriv_exp_1_d0 = value_exp_1;

d_p2_v_dV_ci_ei = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_ci_ei))))));
d_p2_v_dV_bi_ei = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_bi_ei))))));
d_p2_v_dV_b_ci = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_b_ci))))));
d_p2_v_dV_tnode_GND = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_tnode_GND))))));
d_p2_v_dV_bi_ci = (-(deriv_exp_1_d0*(o3*(deriv_log_0_d0*((-d_tmp_dV_bi_ci))))));
p2_v = (-value_exp_1);
}
}

d_q_p3_dV_ci_ei = ((d_p2_u_dV_ci_ei+d_p2_v_dV_ci_ei)-d_p2_a_dV_ci_ei*o3);
d_q_p3_dV_bi_ei = ((d_p2_u_dV_bi_ei+d_p2_v_dV_bi_ei)-d_p2_a_dV_bi_ei*o3);
d_q_p3_dV_b_ci = ((d_p2_u_dV_b_ci+d_p2_v_dV_b_ci)-d_p2_a_dV_b_ci*o3);
d_q_p3_dV_tnode_GND = ((d_p2_u_dV_tnode_GND+d_p2_v_dV_tnode_GND)-d_p2_a_dV_tnode_GND*o3);
d_q_p3_dV_bi_ci = ((d_p2_u_dV_bi_ci+d_p2_v_dV_bi_ci)-d_p2_a_dV_bi_ci*o3);
q_p3 = ((p2_u+p2_v)-(p2_a*o3));
}
else
{
{
double value_sqrt_0 = sqrt(((-27.0)/((p2_p*p2_p)*p2_p)));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_tmp_dV_ci_ei = (((-p2_q)*0.5)*(deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dV_ci_ei+(p2_p*d_p2_p_dV_ci_ei+d_p2_p_dV_ci_ei*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p))))+(-d_p2_q_dV_ci_ei)*0.5*value_sqrt_0);
d_tmp_dV_bi_ei = (((-p2_q)*0.5)*(deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dV_bi_ei+(p2_p*d_p2_p_dV_bi_ei+d_p2_p_dV_bi_ei*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p))))+(-d_p2_q_dV_bi_ei)*0.5*value_sqrt_0);
d_tmp_dV_b_ci = (((-p2_q)*0.5)*(deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dV_b_ci+(p2_p*d_p2_p_dV_b_ci+d_p2_p_dV_b_ci*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p))))+(-d_p2_q_dV_b_ci)*0.5*value_sqrt_0);
d_tmp_dV_tnode_GND = (((-p2_q)*0.5)*(deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dV_tnode_GND+(p2_p*d_p2_p_dV_tnode_GND+d_p2_p_dV_tnode_GND*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p))))+(-d_p2_q_dV_tnode_GND)*0.5*value_sqrt_0);
d_tmp_dV_bi_ci = (((-p2_q)*0.5)*(deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dV_bi_ci+(p2_p*d_p2_p_dV_bi_ci+d_p2_p_dV_bi_ci*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p))))+(-d_p2_q_dV_bi_ci)*0.5*value_sqrt_0);
tmp = (((-p2_q)*0.5)*value_sqrt_0);
}

d_tmp2_dV_ci_ei = (tmp*d_tmp_dV_ci_ei+d_tmp_dV_ci_ei*tmp);
d_tmp2_dV_bi_ei = (tmp*d_tmp_dV_bi_ei+d_tmp_dV_bi_ei*tmp);
d_tmp2_dV_b_ci = (tmp*d_tmp_dV_b_ci+d_tmp_dV_b_ci*tmp);
d_tmp2_dV_tnode_GND = (tmp*d_tmp_dV_tnode_GND+d_tmp_dV_tnode_GND*tmp);
d_tmp2_dV_bi_ci = (tmp*d_tmp_dV_bi_ci+d_tmp_dV_bi_ci*tmp);
tmp2 = (tmp*tmp);
if ((tmp>=0))
{
{
double value_sqrt_0 = sqrt((tmp2/(1-tmp2)));
double value_atan_1 = atan(value_sqrt_0);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_atan_1_d0 = (+1.0/(1+value_sqrt_0*value_sqrt_0));

d_tmp_dV_ci_ei = (-(deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_ci_ei-tmp2*(-d_tmp2_dV_ci_ei))/(1-tmp2)/(1-tmp2)))))));
d_tmp_dV_bi_ei = (-(deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_bi_ei-tmp2*(-d_tmp2_dV_bi_ei))/(1-tmp2)/(1-tmp2)))))));
d_tmp_dV_b_ci = (-(deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_b_ci-tmp2*(-d_tmp2_dV_b_ci))/(1-tmp2)/(1-tmp2)))))));
d_tmp_dV_tnode_GND = (-(deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_tnode_GND-tmp2*(-d_tmp2_dV_tnode_GND))/(1-tmp2)/(1-tmp2)))))));
d_tmp_dV_bi_ci = (-(deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_bi_ci-tmp2*(-d_tmp2_dV_bi_ci))/(1-tmp2)/(1-tmp2)))))));
tmp = ((3.14159265358979323846/2)-value_atan_1);
}
}
else
{
{
double value_sqrt_0 = sqrt((tmp2/(1-tmp2)));
double value_atan_1 = atan(value_sqrt_0);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_atan_1_d0 = (+1.0/(1+value_sqrt_0*value_sqrt_0));

d_tmp_dV_ci_ei = (deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_ci_ei-tmp2*(-d_tmp2_dV_ci_ei))/(1-tmp2)/(1-tmp2))))));
d_tmp_dV_bi_ei = (deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_bi_ei-tmp2*(-d_tmp2_dV_bi_ei))/(1-tmp2)/(1-tmp2))))));
d_tmp_dV_b_ci = (deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_b_ci-tmp2*(-d_tmp2_dV_b_ci))/(1-tmp2)/(1-tmp2))))));
d_tmp_dV_tnode_GND = (deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_tnode_GND-tmp2*(-d_tmp2_dV_tnode_GND))/(1-tmp2)/(1-tmp2))))));
d_tmp_dV_bi_ci = (deriv_atan_1_d0*((deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dV_bi_ci-tmp2*(-d_tmp2_dV_bi_ci))/(1-tmp2)/(1-tmp2))))));
tmp = ((3.14159265358979323846/2)+value_atan_1);
}
}
{
double value_sqrt_0 = sqrt((((-4)*p2_p)*o3));
double value_cos_1 = cos((o3*tmp));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_cos_1_d0 = (-sin((o3*tmp)));

d_tmp_dV_ci_ei = ((value_sqrt_0*(deriv_cos_1_d0*(o3*d_tmp_dV_ci_ei))+(deriv_sqrt_0_d0*((-4)*d_p2_p_dV_ci_ei*o3))*value_cos_1)-d_p2_a_dV_ci_ei*o3);
d_tmp_dV_b_ci = ((value_sqrt_0*(deriv_cos_1_d0*(o3*d_tmp_dV_b_ci))+(deriv_sqrt_0_d0*((-4)*d_p2_p_dV_b_ci*o3))*value_cos_1)-d_p2_a_dV_b_ci*o3);
d_tmp_dV_bi_ci = ((value_sqrt_0*(deriv_cos_1_d0*(o3*d_tmp_dV_bi_ci))+(deriv_sqrt_0_d0*((-4)*d_p2_p_dV_bi_ci*o3))*value_cos_1)-d_p2_a_dV_bi_ci*o3);
d_tmp_dV_bi_ei = ((value_sqrt_0*(deriv_cos_1_d0*(o3*d_tmp_dV_bi_ei))+(deriv_sqrt_0_d0*((-4)*d_p2_p_dV_bi_ei*o3))*value_cos_1)-d_p2_a_dV_bi_ei*o3);
d_tmp_dV_tnode_GND = ((value_sqrt_0*(deriv_cos_1_d0*(o3*d_tmp_dV_tnode_GND))+(deriv_sqrt_0_d0*((-4)*d_p2_p_dV_tnode_GND*o3))*value_cos_1)-d_p2_a_dV_tnode_GND*o3);
tmp = ((value_sqrt_0*value_cos_1)-(p2_a*o3));
}

d_q_p3_dV_ci_ei = d_tmp_dV_ci_ei;
d_q_p3_dV_bi_ei = d_tmp_dV_bi_ei;
d_q_p3_dV_b_ci = d_tmp_dV_b_ci;
d_q_p3_dV_tnode_GND = d_tmp_dV_tnode_GND;
d_q_p3_dV_bi_ci = d_tmp_dV_bi_ci;
q_p3 = tmp;
}
}

d_qpt_dV_ci_ei = d_q_p3_dV_ci_ei;
d_qpt_dV_bi_ei = d_q_p3_dV_bi_ei;
d_qpt_dV_b_ci = d_q_p3_dV_b_ci;
d_qpt_dV_tnode_GND = d_q_p3_dV_tnode_GND;
d_qpt_dV_bi_ci = d_q_p3_dV_bi_ci;
qpt = q_p3;
}
if ((qpt<=1e-20))
{

d_qpt_dV_bi_ci = d_qpt_dV_tnode_GND = d_qpt_dV_b_ci = d_qpt_dV_bi_ei = d_qpt_dV_ci_ei =  0.0;
qpt = 1e-20;
}

d_itf_dV_ci_ei = (-itfi*d_qpt_dV_ci_ei/qpt/qpt);
d_itf_dV_b_ci = (-itfi*d_qpt_dV_b_ci/qpt/qpt);
d_itf_dV_bi_ci = (-itfi*d_qpt_dV_bi_ci/qpt/qpt);
d_itf_dV_bi_ei = ((qpt*d_itfi_dV_bi_ei-itfi*d_qpt_dV_bi_ei)/qpt/qpt);
d_itf_dV_tnode_GND = ((qpt*d_itfi_dV_tnode_GND-itfi*d_qpt_dV_tnode_GND)/qpt/qpt);
itf = (itfi/qpt);

d_itr_dV_ci_ei = (-itri*d_qpt_dV_ci_ei/qpt/qpt);
d_itr_dV_bi_ei = (-itri*d_qpt_dV_bi_ei/qpt/qpt);
d_itr_dV_b_ci = (-itri*d_qpt_dV_b_ci/qpt/qpt);
d_itr_dV_bi_ci = ((qpt*d_itri_dV_bi_ci-itri*d_qpt_dV_bi_ci)/qpt/qpt);
d_itr_dV_tnode_GND = ((qpt*d_itri_dV_tnode_GND-itri*d_qpt_dV_tnode_GND)/qpt/qpt);
itr = (itri/qpt);
if ((itf<=1e-20))
{

d_itf_dV_tnode_GND = d_itf_dV_bi_ei = d_itf_dV_bi_ci = d_itf_dV_b_ci = d_itf_dV_ci_ei =  0.0;
itf = 1e-20;
}

d_it_dV_xf2_GND =  0.0;
d_it_dV_ci_ei = (d_itf_dV_ci_ei-d_itr_dV_ci_ei);
d_it_dV_b_ci = (d_itf_dV_b_ci-d_itr_dV_b_ci);
d_it_dV_bi_ci = (d_itf_dV_bi_ci-d_itr_dV_bi_ci);
d_it_dV_bi_ei = (d_itf_dV_bi_ei-d_itr_dV_bi_ei);
d_it_dV_tnode_GND = (d_itf_dV_tnode_GND-d_itr_dV_tnode_GND);
it = (itf-itr);

d_qf0_dV_ci_ei = tf0*d_itf_dV_ci_ei;
d_qf0_dV_bi_ei = tf0*d_itf_dV_bi_ei;
d_qf0_dV_b_ci = (tf0*d_itf_dV_b_ci+d_tf0_dV_b_ci*itf);
d_qf0_dV_bi_ci = (tf0*d_itf_dV_bi_ci+d_tf0_dV_bi_ci*itf);
d_qf0_dV_tnode_GND = (tf0*d_itf_dV_tnode_GND+d_tf0_dV_tnode_GND*itf);
qf0 = (tf0*itf);

d_a_dV_b_ci = (-(-ick*d_itf_dV_b_ci/itf/itf));
d_a_dV_bi_ci = (-(-ick*d_itf_dV_bi_ci/itf/itf));
d_a_dV_bi_ei = (-(-ick*d_itf_dV_bi_ei/itf/itf));
d_a_dV_ci_ei = (-((itf*d_ick_dV_ci_ei-ick*d_itf_dV_ci_ei)/itf/itf));
d_a_dV_tnode_GND = (-((itf*d_ick_dV_tnode_GND-ick*d_itf_dV_tnode_GND)/itf/itf));
a = (1-(ick/itf));
{
double value_sqrt_0 = sqrt(((a*a)+(model_.ahc)));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_s3_dV_tnode_GND = (deriv_sqrt_0_d0*((a*d_a_dV_tnode_GND+d_a_dV_tnode_GND*a)));
d_s3_dV_b_ci = (deriv_sqrt_0_d0*((a*d_a_dV_b_ci+d_a_dV_b_ci*a)));
d_s3_dV_bi_ci = (deriv_sqrt_0_d0*((a*d_a_dV_bi_ci+d_a_dV_bi_ci*a)));
d_s3_dV_bi_ei = (deriv_sqrt_0_d0*((a*d_a_dV_bi_ei+d_a_dV_bi_ei*a)));
d_s3_dV_ci_ei = (deriv_sqrt_0_d0*((a*d_a_dV_ci_ei+d_a_dV_ci_ei*a)));
s3 = value_sqrt_0;
}
{
double value_sqrt_0 = sqrt((1+(model_.ahc)));

d_w_dV_tnode_GND = ((d_a_dV_tnode_GND+d_s3_dV_tnode_GND)/(1+value_sqrt_0));
d_w_dV_b_ci = ((d_a_dV_b_ci+d_s3_dV_b_ci)/(1+value_sqrt_0));
d_w_dV_bi_ci = ((d_a_dV_bi_ci+d_s3_dV_bi_ci)/(1+value_sqrt_0));
d_w_dV_bi_ei = ((d_a_dV_bi_ei+d_s3_dV_bi_ei)/(1+value_sqrt_0));
d_w_dV_ci_ei = ((d_a_dV_ci_ei+d_s3_dV_ci_ei)/(1+value_sqrt_0));
w = ((a+s3)/(1+value_sqrt_0));
}

d_tww_dV_b_ci = ((thcs_t*w)*d_w_dV_b_ci+thcs_t*d_w_dV_b_ci*w);
d_tww_dV_bi_ci = ((thcs_t*w)*d_w_dV_bi_ci+thcs_t*d_w_dV_bi_ci*w);
d_tww_dV_bi_ei = ((thcs_t*w)*d_w_dV_bi_ei+thcs_t*d_w_dV_bi_ei*w);
d_tww_dV_ci_ei = ((thcs_t*w)*d_w_dV_ci_ei+thcs_t*d_w_dV_ci_ei*w);
d_tww_dV_tnode_GND = ((thcs_t*w)*d_w_dV_tnode_GND+(thcs_t*d_w_dV_tnode_GND+d_thcs_t_dV_tnode_GND*w)*w);
tww = ((thcs_t*w)*w);

d_dqfh_dV_b_ci = (tww*d_itf_dV_b_ci+d_tww_dV_b_ci*itf);
d_dqfh_dV_bi_ci = (tww*d_itf_dV_bi_ci+d_tww_dV_bi_ci*itf);
d_dqfh_dV_bi_ei = (tww*d_itf_dV_bi_ei+d_tww_dV_bi_ei*itf);
d_dqfh_dV_ci_ei = (tww*d_itf_dV_ci_ei+d_tww_dV_ci_ei*itf);
d_dqfh_dV_tnode_GND = (tww*d_itf_dV_tnode_GND+d_tww_dV_tnode_GND*itf);
dqfh = (tww*itf);

d_dtfh_dV_b_ci = (tww*((s3*(-(2*ick)*d_itf_dV_b_ci/itf/itf)-((2*ick)/itf)*d_s3_dV_b_ci)/s3/s3)+d_tww_dV_b_ci*(1+(((2*ick)/itf)/s3)));
d_dtfh_dV_bi_ci = (tww*((s3*(-(2*ick)*d_itf_dV_bi_ci/itf/itf)-((2*ick)/itf)*d_s3_dV_bi_ci)/s3/s3)+d_tww_dV_bi_ci*(1+(((2*ick)/itf)/s3)));
d_dtfh_dV_bi_ei = (tww*((s3*(-(2*ick)*d_itf_dV_bi_ei/itf/itf)-((2*ick)/itf)*d_s3_dV_bi_ei)/s3/s3)+d_tww_dV_bi_ei*(1+(((2*ick)/itf)/s3)));
d_dtfh_dV_ci_ei = (tww*((s3*((itf*2*d_ick_dV_ci_ei-(2*ick)*d_itf_dV_ci_ei)/itf/itf)-((2*ick)/itf)*d_s3_dV_ci_ei)/s3/s3)+d_tww_dV_ci_ei*(1+(((2*ick)/itf)/s3)));
d_dtfh_dV_tnode_GND = (tww*((s3*((itf*2*d_ick_dV_tnode_GND-(2*ick)*d_itf_dV_tnode_GND)/itf/itf)-((2*ick)/itf)*d_s3_dV_tnode_GND)/s3/s3)+d_tww_dV_tnode_GND*(1+(((2*ick)/itf)/s3)));
dtfh = (tww*(1+(((2*ick)/itf)/s3)));
{
double value_log_0 = log((itf/ick));
double value_exp_1 = exp(((model_.gte)*value_log_0));
double  deriv_log_0_d0 = (1.0/(itf/ick));
double  deriv_exp_1_d0 = value_exp_1;

d_dtef_dV_ci_ei = tef0_t*(deriv_exp_1_d0*((model_.gte)*(deriv_log_0_d0*(((ick*d_itf_dV_ci_ei-itf*d_ick_dV_ci_ei)/ick/ick)))));
d_dtef_dV_b_ci = tef0_t*(deriv_exp_1_d0*((model_.gte)*(deriv_log_0_d0*((d_itf_dV_b_ci/ick)))));
d_dtef_dV_bi_ci = tef0_t*(deriv_exp_1_d0*((model_.gte)*(deriv_log_0_d0*((d_itf_dV_bi_ci/ick)))));
d_dtef_dV_bi_ei = tef0_t*(deriv_exp_1_d0*((model_.gte)*(deriv_log_0_d0*((d_itf_dV_bi_ei/ick)))));
d_dtef_dV_tnode_GND = (tef0_t*(deriv_exp_1_d0*((model_.gte)*(deriv_log_0_d0*(((ick*d_itf_dV_tnode_GND-itf*d_ick_dV_tnode_GND)/ick/ick)))))+d_tef0_t_dV_tnode_GND*value_exp_1);
dtef = (tef0_t*value_exp_1);
}

d_dqef_dV_ci_ei = ((dtef*d_itf_dV_ci_ei+d_dtef_dV_ci_ei*itf)/((model_.gte)+1.0));
d_dqef_dV_b_ci = ((dtef*d_itf_dV_b_ci+d_dtef_dV_b_ci*itf)/((model_.gte)+1.0));
d_dqef_dV_bi_ci = ((dtef*d_itf_dV_bi_ci+d_dtef_dV_bi_ci*itf)/((model_.gte)+1.0));
d_dqef_dV_bi_ei = ((dtef*d_itf_dV_bi_ei+d_dtef_dV_bi_ei*itf)/((model_.gte)+1.0));
d_dqef_dV_tnode_GND = ((dtef*d_itf_dV_tnode_GND+d_dtef_dV_tnode_GND*itf)/((model_.gte)+1.0));
dqef = ((dtef*itf)/((model_.gte)+1.0));

d_qf_dV_ci_ei = ((d_qf0_dV_ci_ei+d_dqef_dV_ci_ei)+d_dqfh_dV_ci_ei);
d_qf_dV_bi_ei = ((d_qf0_dV_bi_ei+d_dqef_dV_bi_ei)+d_dqfh_dV_bi_ei);
d_qf_dV_b_ci = ((d_qf0_dV_b_ci+d_dqef_dV_b_ci)+d_dqfh_dV_b_ci);
d_qf_dV_bi_ci = ((d_qf0_dV_bi_ci+d_dqef_dV_bi_ci)+d_dqfh_dV_bi_ci);
d_qf_dV_tnode_GND = ((d_qf0_dV_tnode_GND+d_dqef_dV_tnode_GND)+d_dqfh_dV_tnode_GND);
qf = ((qf0+dqef)+dqfh);

d_tf_dV_bi_ei = (d_dtfh_dV_bi_ei+d_dtef_dV_bi_ei);
d_tf_dV_ci_ei = (d_dtfh_dV_ci_ei+d_dtef_dV_ci_ei);
d_tf_dV_b_ci = ((d_tf0_dV_b_ci+d_dtfh_dV_b_ci)+d_dtef_dV_b_ci);
d_tf_dV_bi_ci = ((d_tf0_dV_bi_ci+d_dtfh_dV_bi_ci)+d_dtef_dV_bi_ci);
d_tf_dV_tnode_GND = ((d_tf0_dV_tnode_GND+d_dtfh_dV_tnode_GND)+d_dtef_dV_tnode_GND);
tf = ((tf0+dtfh)+dtef);

d_qr_dV_ci_ei = (model_.tr)*d_itr_dV_ci_ei;
d_qr_dV_bi_ei = (model_.tr)*d_itr_dV_bi_ei;
d_qr_dV_b_ci = (model_.tr)*d_itr_dV_b_ci;
d_qr_dV_bi_ci = (model_.tr)*d_itr_dV_bi_ci;
d_qr_dV_tnode_GND = (model_.tr)*d_itr_dV_tnode_GND;
qr = ((model_.tr)*itr);

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci =  0.0;
d_DIOY_dV_tnode_GND = (-Vbiei*(model_.mbe)*d_VT_dV_tnode_GND/((model_.mbe)*VT)/((model_.mbe)*VT));
d_DIOY_dV_bi_ei = (d_Vbiei_dV_bi_ei/((model_.mbe)*VT));
DIOY = (Vbiei/((model_.mbe)*VT));
if (((model_.ibes)>0.0))
{
if ((DIOY>80))
{

d_le_dV_s_ci = d_le_dV_bi_ci =  0.0;
d_le_dV_tnode_GND = d_DIOY_dV_tnode_GND;
d_le_dV_bi_ei = d_DIOY_dV_bi_ei;
le = (1+(DIOY-80));

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci = d_DIOY_dV_bi_ei = d_DIOY_dV_tnode_GND =  0.0;
DIOY = 80;
}
else
{

d_le_dV_s_ci = d_le_dV_bi_ci = d_le_dV_bi_ei = d_le_dV_tnode_GND =  0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));

d_le_dV_s_ci = d_le_dV_bi_ci =  0.0;
d_le_dV_tnode_GND = (le*(deriv_limexp_0_d0*(d_DIOY_dV_tnode_GND))+d_le_dV_tnode_GND*value_limexp_0);
d_le_dV_bi_ei = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ei))+d_le_dV_bi_ei*value_limexp_0);
le = (le*value_limexp_0);
}

d_ibe_dV_bi_ei = ibes_t*d_le_dV_bi_ei;
d_ibe_dV_tnode_GND = (ibes_t*d_le_dV_tnode_GND+d_ibes_t_dV_tnode_GND*(le-1.0));
ibe = (ibes_t*(le-1.0));
if ((DIOY<=(-14.0)))
{

d_ibe_dV_bi_ei =  0.0;
d_ibe_dV_tnode_GND = (-d_ibes_t_dV_tnode_GND);
ibe = (-ibes_t);
}
}
else
{

d_ibe_dV_tnode_GND = d_ibe_dV_bi_ei =  0.0;
ibe = 0.0;
}

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci =  0.0;
d_DIOY_dV_tnode_GND = (-Vbiei*(model_.mre)*d_VT_dV_tnode_GND/((model_.mre)*VT)/((model_.mre)*VT));
d_DIOY_dV_bi_ei = (d_Vbiei_dV_bi_ei/((model_.mre)*VT));
DIOY = (Vbiei/((model_.mre)*VT));
if (((model_.ires)>0.0))
{
if ((DIOY>80))
{

d_le_dV_s_ci = d_le_dV_bi_ci =  0.0;
d_le_dV_tnode_GND = d_DIOY_dV_tnode_GND;
d_le_dV_bi_ei = d_DIOY_dV_bi_ei;
le = (1+(DIOY-80));

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci = d_DIOY_dV_bi_ei = d_DIOY_dV_tnode_GND =  0.0;
DIOY = 80;
}
else
{

d_le_dV_s_ci = d_le_dV_bi_ci = d_le_dV_bi_ei = d_le_dV_tnode_GND =  0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));

d_le_dV_s_ci = d_le_dV_bi_ci =  0.0;
d_le_dV_tnode_GND = (le*(deriv_limexp_0_d0*(d_DIOY_dV_tnode_GND))+d_le_dV_tnode_GND*value_limexp_0);
d_le_dV_bi_ei = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ei))+d_le_dV_bi_ei*value_limexp_0);
le = (le*value_limexp_0);
}

d_ire_dV_bi_ei = ires_t*d_le_dV_bi_ei;
d_ire_dV_tnode_GND = (ires_t*d_le_dV_tnode_GND+d_ires_t_dV_tnode_GND*(le-1.0));
ire = (ires_t*(le-1.0));
if ((DIOY<=(-14.0)))
{

d_ire_dV_bi_ei =  0.0;
d_ire_dV_tnode_GND = (-d_ires_t_dV_tnode_GND);
ire = (-ires_t);
}
}
else
{

d_ire_dV_tnode_GND = d_ire_dV_bi_ei =  0.0;
ire = 0.0;
}

d_ijbe_dV_bi_ei = (d_ibe_dV_bi_ei+d_ire_dV_bi_ei);
d_ijbe_dV_tnode_GND = (d_ibe_dV_tnode_GND+d_ire_dV_tnode_GND);
ijbe = (ibe+ire);

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ei =  0.0;
d_DIOY_dV_tnode_GND = (-Vbici*(model_.mbc)*d_VT_dV_tnode_GND/((model_.mbc)*VT)/((model_.mbc)*VT));
d_DIOY_dV_bi_ci = (d_Vbici_dV_bi_ci/((model_.mbc)*VT));
DIOY = (Vbici/((model_.mbc)*VT));
if (((model_.ibcs)>0.0))
{
if ((DIOY>80))
{

d_le_dV_s_ci =  0.0;
d_le_dV_tnode_GND = d_DIOY_dV_tnode_GND;
d_le_dV_bi_ei = d_DIOY_dV_bi_ei;
d_le_dV_bi_ci = d_DIOY_dV_bi_ci;
le = (1+(DIOY-80));

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci = d_DIOY_dV_bi_ei = d_DIOY_dV_tnode_GND =  0.0;
DIOY = 80;
}
else
{

d_le_dV_s_ci = d_le_dV_bi_ci = d_le_dV_bi_ei = d_le_dV_tnode_GND =  0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));

d_le_dV_s_ci =  0.0;
d_le_dV_tnode_GND = (le*(deriv_limexp_0_d0*(d_DIOY_dV_tnode_GND))+d_le_dV_tnode_GND*value_limexp_0);
d_le_dV_bi_ei = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ei))+d_le_dV_bi_ei*value_limexp_0);
d_le_dV_bi_ci = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ci))+d_le_dV_bi_ci*value_limexp_0);
le = (le*value_limexp_0);
}

d_ijbc_dV_bi_ei = ibcs_t*d_le_dV_bi_ei;
d_ijbc_dV_bi_ci = ibcs_t*d_le_dV_bi_ci;
d_ijbc_dV_tnode_GND = (ibcs_t*d_le_dV_tnode_GND+d_ibcs_t_dV_tnode_GND*(le-1.0));
ijbc = (ibcs_t*(le-1.0));
if ((DIOY<=(-14.0)))
{

d_ijbc_dV_bi_ci = d_ijbc_dV_bi_ei =  0.0;
d_ijbc_dV_tnode_GND = (-d_ibcs_t_dV_tnode_GND);
ijbc = (-ibcs_t);
}
}
else
{

d_ijbc_dV_tnode_GND = d_ijbc_dV_bi_ci = d_ijbc_dV_bi_ei =  0.0;
ijbc = 0.0;
}

d_ibi_dV_bi_ci = d_ijbc_dV_bi_ci;
d_ibi_dV_bi_ei = (d_ijbe_dV_bi_ei+d_ijbc_dV_bi_ei);
d_ibi_dV_tnode_GND = (d_ijbe_dV_tnode_GND+d_ijbc_dV_tnode_GND);
ibi = (ijbe+ijbc);
if ((Vbici<0))
//Begin block HICAVL
{

d_v_bord_dV_tnode_GND = (eavl_t*d_vdci_t_dV_tnode_GND+d_eavl_t_dV_tnode_GND*vdci_t);
v_bord = (eavl_t*vdci_t);
if (((vdci_t-Vbici)>v_bord))
{
{
double value_exp_0 = exp((-cc));
double  deriv_exp_0_d0 = value_exp_0;

d_a_iavl_dV_b_ci = (kavl_t/vdci_t)*(deriv_exp_0_d0*((-d_cc_dV_b_ci)));
d_a_iavl_dV_bi_ci = (kavl_t/vdci_t)*(deriv_exp_0_d0*((-d_cc_dV_bi_ci)));
d_a_iavl_dV_tnode_GND = ((kavl_t/vdci_t)*(deriv_exp_0_d0*((-d_cc_dV_tnode_GND)))+((vdci_t*d_kavl_t_dV_tnode_GND-kavl_t*d_vdci_t_dV_tnode_GND)/vdci_t/vdci_t)*value_exp_0);
a_iavl = ((kavl_t/vdci_t)*value_exp_0);
}

d_iavl_dV_ci_ei = d_itf_dV_ci_ei*a_iavl*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord)));
d_iavl_dV_b_ci = ((itf*a_iavl)*d_cc_dV_b_ci*((vdci_t-Vbici)-v_bord)+(itf*d_a_iavl_dV_b_ci+d_itf_dV_b_ci*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
d_iavl_dV_bi_ci = ((itf*a_iavl)*((1+cc)*(-d_Vbici_dV_bi_ci)+d_cc_dV_bi_ci*((vdci_t-Vbici)-v_bord))+(itf*d_a_iavl_dV_bi_ci+d_itf_dV_bi_ci*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
d_iavl_dV_bi_ei = d_itf_dV_bi_ei*a_iavl*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord)));
d_iavl_dV_tnode_GND = ((itf*a_iavl)*(d_v_bord_dV_tnode_GND+((1+cc)*(d_vdci_t_dV_tnode_GND-d_v_bord_dV_tnode_GND)+d_cc_dV_tnode_GND*((vdci_t-Vbici)-v_bord)))+(itf*d_a_iavl_dV_tnode_GND+d_itf_dV_tnode_GND*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
iavl = ((itf*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
}
else
{
{
double value_log_0 = log((1/cc));
double  deriv_log_0_d0 = (1.0/(1/cc));

d_lncc_dV_b_ci = (deriv_log_0_d0*((-1*d_cc_dV_b_ci/cc/cc)));
d_lncc_dV_bi_ci = (deriv_log_0_d0*((-1*d_cc_dV_bi_ci/cc/cc)));
d_lncc_dV_tnode_GND = (deriv_log_0_d0*((-1*d_cc_dV_tnode_GND/cc/cc)));
lncc = value_log_0;
}
{
double value_exp_0 = exp((((1/(model_.zci))-1)*lncc));
double value_exp_1 = exp(((((-1)/(model_.zci))*lncc)-(eavl_t*value_exp_0)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;

d_iavl_dV_ci_ei = kavl_t*d_itf_dV_ci_ei*value_exp_1;
d_iavl_dV_b_ci = ((kavl_t*itf)*(deriv_exp_1_d0*((((-1)/(model_.zci))*d_lncc_dV_b_ci-eavl_t*(deriv_exp_0_d0*(((1/(model_.zci))-1)*d_lncc_dV_b_ci)))))+kavl_t*d_itf_dV_b_ci*value_exp_1);
d_iavl_dV_bi_ci = ((kavl_t*itf)*(deriv_exp_1_d0*((((-1)/(model_.zci))*d_lncc_dV_bi_ci-eavl_t*(deriv_exp_0_d0*(((1/(model_.zci))-1)*d_lncc_dV_bi_ci)))))+kavl_t*d_itf_dV_bi_ci*value_exp_1);
d_iavl_dV_bi_ei = kavl_t*d_itf_dV_bi_ei*value_exp_1;
d_iavl_dV_tnode_GND = ((kavl_t*itf)*(deriv_exp_1_d0*((((-1)/(model_.zci))*d_lncc_dV_tnode_GND-(eavl_t*(deriv_exp_0_d0*(((1/(model_.zci))-1)*d_lncc_dV_tnode_GND))+d_eavl_t_dV_tnode_GND*value_exp_0))))+(kavl_t*d_itf_dV_tnode_GND+d_kavl_t_dV_tnode_GND*itf)*value_exp_1);
iavl = ((kavl_t*itf)*value_exp_1);
}
}
}
// End block HICAVL
else
{

d_iavl_dV_tnode_GND = d_iavl_dV_bi_ei = d_iavl_dV_bi_ci = d_iavl_dV_b_ci = d_iavl_dV_ci_ei =  0.0;
iavl = 0;
}
if ((cje0_t>0.0))
{
{
double value_log_0 = log(aje_t);
double value_exp_1 = exp(((-value_log_0)/(model_.ze)));
double  deriv_log_0_d0 = (1.0/aje_t);
double  deriv_exp_1_d0 = value_exp_1;

d_vf_dV_tnode_GND = (vde_t*(-(deriv_exp_1_d0*(((-(deriv_log_0_d0*(d_aje_t_dV_tnode_GND)))/(model_.ze)))))+d_vde_t_dV_tnode_GND*(1.0-value_exp_1));
vf = (vde_t*(1.0-value_exp_1));
}

d_xvf_dV_s_ci = d_xvf_dV_bi_ci = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_bi_ei = ((-d_Vbiei_dV_bi_ei)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vbiei)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vbiei)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_s_ci =  0.0;
d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
d_xvf2_dV_bi_ei = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ei+d_xvf_dV_bi_ei*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_s_ci =  0.0;
d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_bi_ei = (-VT*(d_xvf_dV_bi_ei+d_xvf2_dV_bi_ei)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.ze));
{
double value_log_0 = log((1.0-(v_j/vde_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vde_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_s_ci =  0.0;
d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vde_t)))))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vde_t)))))));
d_y_dV_bi_ei = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ei/vde_t)))))));
d_y_dV_ci_ei = (-(deriv_exp_1_d0*(d_x_dV_ci_ei*value_log_0)));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vde_t*d_v_j_dV_tnode_GND-v_j*d_vde_t_dV_tnode_GND)/vde_t/vde_t))))+d_x_dV_tnode_GND*value_log_0))));
y = (1.0-value_exp_1);
}

d_qjei_dV_b_ci = (((cje0_t*vde_t)*d_y_dV_b_ci/x)+(aje_t*cje0_t)*(-d_v_j_dV_b_ci));
d_qjei_dV_bi_ci = (((cje0_t*vde_t)*d_y_dV_bi_ci/x)+(aje_t*cje0_t)*(-d_v_j_dV_bi_ci));
d_qjei_dV_bi_ei = (((cje0_t*vde_t)*d_y_dV_bi_ei/x)+(aje_t*cje0_t)*(d_Vbiei_dV_bi_ei-d_v_j_dV_bi_ei));
d_qjei_dV_ci_ei = ((x*(cje0_t*vde_t)*d_y_dV_ci_ei-((cje0_t*vde_t)*y)*d_x_dV_ci_ei)/x/x);
d_qjei_dV_tnode_GND = (((x*((cje0_t*vde_t)*d_y_dV_tnode_GND+(cje0_t*d_vde_t_dV_tnode_GND+d_cje0_t_dV_tnode_GND*vde_t)*y)-((cje0_t*vde_t)*y)*d_x_dV_tnode_GND)/x/x)+((aje_t*cje0_t)*(-d_v_j_dV_tnode_GND)+(aje_t*d_cje0_t_dV_tnode_GND+d_aje_t_dV_tnode_GND*cje0_t)*(Vbiei-v_j)));
qjei = ((((cje0_t*vde_t)*y)/x)+((aje_t*cje0_t)*(Vbiei-v_j)));
}
else
{

d_qjei_dV_tnode_GND = d_qjei_dV_ci_ei = d_qjei_dV_bi_ei = d_qjei_dV_bi_ci = d_qjei_dV_b_ci =  0.0;
qjei = 0.00;
}

d_qje_dV_b_ci = (d_qjei_dV_b_ci/cje0_t);
d_qje_dV_bi_ci = (d_qjei_dV_bi_ci/cje0_t);
d_qje_dV_bi_ei = (d_qjei_dV_bi_ei/cje0_t);
d_qje_dV_ci_ei = (d_qjei_dV_ci_ei/cje0_t);
d_qje_dV_tnode_GND = ((cje0_t*d_qjei_dV_tnode_GND-qjei*d_cje0_t_dV_tnode_GND)/cje0_t/cje0_t);
qje = (qjei/cje0_t);
if ((rbi0_t>0.0))
//Begin block HICRBI
{

d_Qz_nom_dV_b_ci = ((((d_qje_dV_b_ci/(model_.vr0e))+(d_qjci_dV_b_ci/(model_.vr0c)))+((ickf*d_itf_dV_b_ci-itf*d_ickf_dV_b_ci)/ickf/ickf))+(d_itr_dV_b_ci/ickr));
d_Qz_nom_dV_bi_ci = ((((d_qje_dV_bi_ci/(model_.vr0e))+(d_qjci_dV_bi_ci/(model_.vr0c)))+((ickf*d_itf_dV_bi_ci-itf*d_ickf_dV_bi_ci)/ickf/ickf))+(d_itr_dV_bi_ci/ickr));
d_Qz_nom_dV_ci_ei = (((d_qje_dV_ci_ei/(model_.vr0e))+(d_itf_dV_ci_ei/ickf))+(d_itr_dV_ci_ei/ickr));
d_Qz_nom_dV_bi_ei = (((d_qje_dV_bi_ei/(model_.vr0e))+(d_itf_dV_bi_ei/ickf))+(d_itr_dV_bi_ei/ickr));
d_Qz_nom_dV_tnode_GND = ((((d_qje_dV_tnode_GND/(model_.vr0e))+(d_qjci_dV_tnode_GND/(model_.vr0c)))+((ickf*d_itf_dV_tnode_GND-itf*d_ickf_dV_tnode_GND)/ickf/ickf))+(d_itr_dV_tnode_GND/ickr));
Qz_nom = ((((1+(qje/(model_.vr0e)))+(qjci/(model_.vr0c)))+(itf/ickf))+(itr/ickr));
{
double value_sqrt_0 = sqrt(((Qz_nom*Qz_nom)+0.01));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_fQz_dV_b_ci = 0.5*(d_Qz_nom_dV_b_ci+(deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dV_b_ci+d_Qz_nom_dV_b_ci*Qz_nom))));
d_fQz_dV_bi_ci = 0.5*(d_Qz_nom_dV_bi_ci+(deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dV_bi_ci+d_Qz_nom_dV_bi_ci*Qz_nom))));
d_fQz_dV_ci_ei = 0.5*(d_Qz_nom_dV_ci_ei+(deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dV_ci_ei+d_Qz_nom_dV_ci_ei*Qz_nom))));
d_fQz_dV_bi_ei = 0.5*(d_Qz_nom_dV_bi_ei+(deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dV_bi_ei+d_Qz_nom_dV_bi_ei*Qz_nom))));
d_fQz_dV_tnode_GND = 0.5*(d_Qz_nom_dV_tnode_GND+(deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dV_tnode_GND+d_Qz_nom_dV_tnode_GND*Qz_nom))));
fQz = (0.5*(Qz_nom+value_sqrt_0));
}

d_rbi_dV_b_ci = (-rbi0_t*d_fQz_dV_b_ci/fQz/fQz);
d_rbi_dV_bi_ci = (-rbi0_t*d_fQz_dV_bi_ci/fQz/fQz);
d_rbi_dV_ci_ei = (-rbi0_t*d_fQz_dV_ci_ei/fQz/fQz);
d_rbi_dV_bi_ei = (-rbi0_t*d_fQz_dV_bi_ei/fQz/fQz);
d_rbi_dV_tnode_GND = ((fQz*d_rbi0_t_dV_tnode_GND-rbi0_t*d_fQz_dV_tnode_GND)/fQz/fQz);
rbi = (rbi0_t/fQz);
if ((ibi>0.0))
{

d_eta_dV_b_ci = ((model_.fgeo)*d_rbi_dV_b_ci*ibi/VT);
d_eta_dV_bi_ci = ((((model_.fgeo)*rbi)*d_ibi_dV_bi_ci+(model_.fgeo)*d_rbi_dV_bi_ci*ibi)/VT);
d_eta_dV_ci_ei = ((model_.fgeo)*d_rbi_dV_ci_ei*ibi/VT);
d_eta_dV_bi_ei = ((((model_.fgeo)*rbi)*d_ibi_dV_bi_ei+(model_.fgeo)*d_rbi_dV_bi_ei*ibi)/VT);
d_eta_dV_tnode_GND = ((VT*(((model_.fgeo)*rbi)*d_ibi_dV_tnode_GND+(model_.fgeo)*d_rbi_dV_tnode_GND*ibi)-(((model_.fgeo)*rbi)*ibi)*d_VT_dV_tnode_GND)/VT/VT);
eta = ((((model_.fgeo)*rbi)*ibi)/VT);
if ((eta<1e-6))
{

d_rbi_dV_b_ci = (rbi*(-0.5*d_eta_dV_b_ci)+d_rbi_dV_b_ci*(1-(0.5*eta)));
d_rbi_dV_bi_ci = (rbi*(-0.5*d_eta_dV_bi_ci)+d_rbi_dV_bi_ci*(1-(0.5*eta)));
d_rbi_dV_ci_ei = (rbi*(-0.5*d_eta_dV_ci_ei)+d_rbi_dV_ci_ei*(1-(0.5*eta)));
d_rbi_dV_bi_ei = (rbi*(-0.5*d_eta_dV_bi_ei)+d_rbi_dV_bi_ei*(1-(0.5*eta)));
d_rbi_dV_tnode_GND = (rbi*(-0.5*d_eta_dV_tnode_GND)+d_rbi_dV_tnode_GND*(1-(0.5*eta)));
rbi = (rbi*(1-(0.5*eta)));
}
else
{
{
double value_log_0 = log((eta+1));
double  deriv_log_0_d0 = (1.0/(eta+1));

d_rbi_dV_b_ci = ((eta*(rbi*(deriv_log_0_d0*(d_eta_dV_b_ci))+d_rbi_dV_b_ci*value_log_0)-(rbi*value_log_0)*d_eta_dV_b_ci)/eta/eta);
d_rbi_dV_bi_ci = ((eta*(rbi*(deriv_log_0_d0*(d_eta_dV_bi_ci))+d_rbi_dV_bi_ci*value_log_0)-(rbi*value_log_0)*d_eta_dV_bi_ci)/eta/eta);
d_rbi_dV_ci_ei = ((eta*(rbi*(deriv_log_0_d0*(d_eta_dV_ci_ei))+d_rbi_dV_ci_ei*value_log_0)-(rbi*value_log_0)*d_eta_dV_ci_ei)/eta/eta);
d_rbi_dV_bi_ei = ((eta*(rbi*(deriv_log_0_d0*(d_eta_dV_bi_ei))+d_rbi_dV_bi_ei*value_log_0)-(rbi*value_log_0)*d_eta_dV_bi_ei)/eta/eta);
d_rbi_dV_tnode_GND = ((eta*(rbi*(deriv_log_0_d0*(d_eta_dV_tnode_GND))+d_rbi_dV_tnode_GND*value_log_0)-(rbi*value_log_0)*d_eta_dV_tnode_GND)/eta/eta);
rbi = ((rbi*value_log_0)/eta);
}
}
}
}
// End block HICRBI
else
{

d_rbi_dV_tnode_GND = d_rbi_dV_bi_ei = d_rbi_dV_ci_ei = d_rbi_dV_bi_ci = d_rbi_dV_b_ci =  0.0;
rbi = 0.0;
}

d_rb_dV_b_ci = d_rbi_dV_b_ci;
d_rb_dV_bi_ci = d_rbi_dV_bi_ci;
d_rb_dV_ci_ei = d_rbi_dV_ci_ei;
d_rb_dV_bi_ei = d_rbi_dV_bi_ei;
d_rb_dV_tnode_GND = (d_rbi_dV_tnode_GND+d_rbx_t_dV_tnode_GND);
rb = (rbi+rbx_t);
if (((model_.itss)>0.0))
//Begin block Sub_Transfer
{

d_HSUM_dV_tnode_GND = (model_.msf)*d_VT_dV_tnode_GND;
HSUM = ((model_.msf)*VT);
{
double value_limexp_0 = limexp((Vbci/HSUM));
double  deriv_limexp_0_d0 = ((((Vbci/HSUM))<80)?(value_limexp_0):exp(80.0));

d_HSa_dV_tnode_GND = (deriv_limexp_0_d0*((-Vbci*d_HSUM_dV_tnode_GND/HSUM/HSUM)));
d_HSa_dV_b_ci = (deriv_limexp_0_d0*((d_Vbci_dV_b_ci/HSUM)));
HSa = value_limexp_0;
}
{
double value_limexp_0 = limexp((Vsci/HSUM));
double  deriv_limexp_0_d0 = ((((Vsci/HSUM))<80)?(value_limexp_0):exp(80.0));

d_HSb_dV_tnode_GND = (deriv_limexp_0_d0*((-Vsci*d_HSUM_dV_tnode_GND/HSUM/HSUM)));
d_HSb_dV_s_ci = (deriv_limexp_0_d0*((d_Vsci_dV_s_ci/HSUM)));
HSb = value_limexp_0;
}

d_HSI_Tsu_dV_s_ci = itss_t*(-d_HSb_dV_s_ci);
d_HSI_Tsu_dV_b_ci = itss_t*d_HSa_dV_b_ci;
d_HSI_Tsu_dV_tnode_GND = (itss_t*(d_HSa_dV_tnode_GND-d_HSb_dV_tnode_GND)+d_itss_t_dV_tnode_GND*(HSa-HSb));
HSI_Tsu = (itss_t*(HSa-HSb));
}
// End block Sub_Transfer
else
{

d_HSI_Tsu_dV_tnode_GND = d_HSI_Tsu_dV_b_ci = d_HSI_Tsu_dV_s_ci =  0.0;
HSI_Tsu = 0.0;
}

d_DIOY_dV_bi_ci = d_DIOY_dV_bi_ei =  0.0;
d_DIOY_dV_tnode_GND = (-Vsci*(model_.msc)*d_VT_dV_tnode_GND/((model_.msc)*VT)/((model_.msc)*VT));
d_DIOY_dV_s_ci = (d_Vsci_dV_s_ci/((model_.msc)*VT));
DIOY = (Vsci/((model_.msc)*VT));
if (((model_.iscs)>0.0))
{
if ((DIOY>80))
{

d_le_dV_tnode_GND = d_DIOY_dV_tnode_GND;
d_le_dV_bi_ei = d_DIOY_dV_bi_ei;
d_le_dV_bi_ci = d_DIOY_dV_bi_ci;
d_le_dV_s_ci = d_DIOY_dV_s_ci;
le = (1+(DIOY-80));

d_DIOY_dV_s_ci = d_DIOY_dV_bi_ci = d_DIOY_dV_bi_ei = d_DIOY_dV_tnode_GND =  0.0;
DIOY = 80;
}
else
{

d_le_dV_s_ci = d_le_dV_bi_ci = d_le_dV_bi_ei = d_le_dV_tnode_GND =  0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));

d_le_dV_tnode_GND = (le*(deriv_limexp_0_d0*(d_DIOY_dV_tnode_GND))+d_le_dV_tnode_GND*value_limexp_0);
d_le_dV_bi_ei = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ei))+d_le_dV_bi_ei*value_limexp_0);
d_le_dV_bi_ci = (le*(deriv_limexp_0_d0*(d_DIOY_dV_bi_ci))+d_le_dV_bi_ci*value_limexp_0);
d_le_dV_s_ci = (le*(deriv_limexp_0_d0*(d_DIOY_dV_s_ci))+d_le_dV_s_ci*value_limexp_0);
le = (le*value_limexp_0);
}

d_ijsc_dV_bi_ei = iscs_t*d_le_dV_bi_ei;
d_ijsc_dV_bi_ci = iscs_t*d_le_dV_bi_ci;
d_ijsc_dV_s_ci = iscs_t*d_le_dV_s_ci;
d_ijsc_dV_tnode_GND = (iscs_t*d_le_dV_tnode_GND+d_iscs_t_dV_tnode_GND*(le-1.0));
ijsc = (iscs_t*(le-1.0));
if ((DIOY<=(-14.0)))
{

d_ijsc_dV_s_ci = d_ijsc_dV_bi_ci = d_ijsc_dV_bi_ei =  0.0;
d_ijsc_dV_tnode_GND = (-d_iscs_t_dV_tnode_GND);
ijsc = (-iscs_t);
}
}
else
{

d_ijsc_dV_tnode_GND = d_ijsc_dV_s_ci = d_ijsc_dV_bi_ci = d_ijsc_dV_bi_ei =  0.0;
ijsc = 0.0;
}
if (((model_.vpts)<1.0e2))
{
if ((cjs0_t>0.0))
{
zr = ((model_.zs)/4.0);

d_vp_dV_tnode_GND = (-d_vds_t_dV_tnode_GND);
vp = ((model_.vpts)-vds_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zs)));

d_vf_dV_tnode_GND = d_vds_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vds_t*(1.0-value_exp_1));
}

d_cmax_dV_tnode_GND = 2.4*d_cjs0_t_dV_tnode_GND;
cmax = (2.4*cjs0_t);
{
double value_log_0 = log((vds_t/(model_.vpts)));
double value_exp_1 = exp((((model_.zs)-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vds_t/(model_.vpts)));
double  deriv_exp_1_d0 = value_exp_1;

d_cr_dV_tnode_GND = (cjs0_t*(deriv_exp_1_d0*(((model_.zs)-zr)*(deriv_log_0_d0*((d_vds_t_dV_tnode_GND/(model_.vpts))))))+d_cjs0_t_dV_tnode_GND*value_exp_1);
cr = (cjs0_t*value_exp_1);
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = d_VT_dV_tnode_GND;
a = VT;

d_ve_dV_b_ci = (-(vf-Vsci)*d_a_dV_b_ci/a/a);
d_ve_dV_bi_ci = (-(vf-Vsci)*d_a_dV_bi_ci/a/a);
d_ve_dV_bi_ei = (-(vf-Vsci)*d_a_dV_bi_ei/a/a);
d_ve_dV_ci_ei = (-(vf-Vsci)*d_a_dV_ci_ei/a/a);
d_ve_dV_s_ci = ((-d_Vsci_dV_s_ci)/a);
d_ve_dV_tnode_GND = ((a*d_vf_dV_tnode_GND-(vf-Vsci)*d_a_dV_tnode_GND)/a/a);
ve = ((vf-Vsci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_ve_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_ve_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_ve_dV_bi_ci));
d_ex1_dV_bi_ei = (deriv_exp_0_d0*(d_ve_dV_bi_ei));
d_ex1_dV_ci_ei = (deriv_exp_0_d0*(d_ve_dV_ci_ei));
d_ex1_dV_s_ci = (deriv_exp_0_d0*(d_ve_dV_s_ci));
ex1 = value_exp_0;
}

d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
d_ee1_dV_bi_ei = d_ex1_dV_bi_ei;
d_ee1_dV_ci_ei = d_ex1_dV_ci_ei;
d_ee1_dV_s_ci = d_ex1_dV_s_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj1_dV_s_ci = (-a*(deriv_log_0_d0*(d_ee1_dV_s_ci)));
d_vj1_dV_b_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0));
d_vj1_dV_bi_ci = (-(a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0));
d_vj1_dV_bi_ei = (-(a*(deriv_log_0_d0*(d_ee1_dV_bi_ei))+d_a_dV_bi_ei*value_log_0));
d_vj1_dV_ci_ei = (-(a*(deriv_log_0_d0*(d_ee1_dV_ci_ei))+d_a_dV_ci_ei*value_log_0));
d_vj1_dV_tnode_GND = (d_vf_dV_tnode_GND-(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{

d_vj1_dV_ci_ei = d_vj1_dV_bi_ei = d_vj1_dV_bi_ci = d_vj1_dV_tnode_GND = d_vj1_dV_b_ci =  0.0;
d_vj1_dV_s_ci = d_Vsci_dV_s_ci;
vj1 = Vsci;
}

d_a_dV_ci_ei = d_a_dV_bi_ei = d_a_dV_bi_ci = d_a_dV_b_ci =  0.0;
d_a_dV_tnode_GND = (0.1*d_vp_dV_tnode_GND+4.0*d_VT_dV_tnode_GND);
a = ((0.1*vp)+(4.0*VT));

d_vr_dV_b_ci = ((a*d_vj1_dV_b_ci-(vp+vj1)*d_a_dV_b_ci)/a/a);
d_vr_dV_bi_ci = ((a*d_vj1_dV_bi_ci-(vp+vj1)*d_a_dV_bi_ci)/a/a);
d_vr_dV_s_ci = (d_vj1_dV_s_ci/a);
d_vr_dV_bi_ei = ((a*d_vj1_dV_bi_ei-(vp+vj1)*d_a_dV_bi_ei)/a/a);
d_vr_dV_ci_ei = ((a*d_vj1_dV_ci_ei-(vp+vj1)*d_a_dV_ci_ei)/a/a);
d_vr_dV_tnode_GND = ((a*(d_vp_dV_tnode_GND+d_vj1_dV_tnode_GND)-(vp+vj1)*d_a_dV_tnode_GND)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;

d_ex1_dV_b_ci = (deriv_exp_0_d0*(d_vr_dV_b_ci));
d_ex1_dV_tnode_GND = (deriv_exp_0_d0*(d_vr_dV_tnode_GND));
d_ex1_dV_bi_ci = (deriv_exp_0_d0*(d_vr_dV_bi_ci));
d_ex1_dV_s_ci = (deriv_exp_0_d0*(d_vr_dV_s_ci));
d_ex1_dV_bi_ei = (deriv_exp_0_d0*(d_vr_dV_bi_ei));
d_ex1_dV_ci_ei = (deriv_exp_0_d0*(d_vr_dV_ci_ei));
ex1 = value_exp_0;
}

d_ee1_dV_b_ci = d_ex1_dV_b_ci;
d_ee1_dV_tnode_GND = d_ex1_dV_tnode_GND;
d_ee1_dV_bi_ci = d_ex1_dV_bi_ci;
d_ee1_dV_bi_ei = d_ex1_dV_bi_ei;
d_ee1_dV_ci_ei = d_ex1_dV_ci_ei;
d_ee1_dV_s_ci = d_ex1_dV_s_ci;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);

d_vj2_dV_s_ci = a*(deriv_log_0_d0*(d_ee1_dV_s_ci));
d_vj2_dV_b_ci = (a*(deriv_log_0_d0*(d_ee1_dV_b_ci))+d_a_dV_b_ci*value_log_0);
d_vj2_dV_bi_ci = (a*(deriv_log_0_d0*(d_ee1_dV_bi_ci))+d_a_dV_bi_ci*value_log_0);
d_vj2_dV_bi_ei = (a*(deriv_log_0_d0*(d_ee1_dV_bi_ei))+d_a_dV_bi_ei*value_log_0);
d_vj2_dV_ci_ei = (a*(deriv_log_0_d0*(d_ee1_dV_ci_ei))+d_a_dV_ci_ei*value_log_0);
d_vj2_dV_tnode_GND = ((-d_vp_dV_tnode_GND)+(a*(deriv_log_0_d0*(d_ee1_dV_tnode_GND))+d_a_dV_tnode_GND*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{

d_vj2_dV_b_ci = d_vj1_dV_b_ci;
d_vj2_dV_tnode_GND = d_vj1_dV_tnode_GND;
d_vj2_dV_bi_ci = d_vj1_dV_bi_ci;
d_vj2_dV_s_ci = d_vj1_dV_s_ci;
d_vj2_dV_bi_ei = d_vj1_dV_bi_ei;
d_vj2_dV_ci_ei = d_vj1_dV_ci_ei;
vj2 = vj1;
}

d_vj4_dV_b_ci = (-d_vj1_dV_b_ci);
d_vj4_dV_tnode_GND = (-d_vj1_dV_tnode_GND);
d_vj4_dV_bi_ci = (-d_vj1_dV_bi_ci);
d_vj4_dV_bi_ei = (-d_vj1_dV_bi_ei);
d_vj4_dV_ci_ei = (-d_vj1_dV_ci_ei);
d_vj4_dV_s_ci = (d_Vsci_dV_s_ci-d_vj1_dV_s_ci);
vj4 = (Vsci-vj1);
ez = (1.0-(model_.zs));
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vds_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vds_t)));

d_vdj1_dV_b_ci = (deriv_log_0_d0*((-(d_vj1_dV_b_ci/vds_t))));
d_vdj1_dV_tnode_GND = (deriv_log_0_d0*((-((vds_t*d_vj1_dV_tnode_GND-vj1*d_vds_t_dV_tnode_GND)/vds_t/vds_t))));
d_vdj1_dV_bi_ci = (deriv_log_0_d0*((-(d_vj1_dV_bi_ci/vds_t))));
d_vdj1_dV_s_ci = (deriv_log_0_d0*((-(d_vj1_dV_s_ci/vds_t))));
d_vdj1_dV_bi_ei = (deriv_log_0_d0*((-(d_vj1_dV_bi_ei/vds_t))));
d_vdj1_dV_ci_ei = (deriv_log_0_d0*((-(d_vj1_dV_ci_ei/vds_t))));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vds_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vds_t)));

d_vdj2_dV_b_ci = (deriv_log_0_d0*((-(d_vj2_dV_b_ci/vds_t))));
d_vdj2_dV_tnode_GND = (deriv_log_0_d0*((-((vds_t*d_vj2_dV_tnode_GND-vj2*d_vds_t_dV_tnode_GND)/vds_t/vds_t))));
d_vdj2_dV_bi_ci = (deriv_log_0_d0*((-(d_vj2_dV_bi_ci/vds_t))));
d_vdj2_dV_s_ci = (deriv_log_0_d0*((-(d_vj2_dV_s_ci/vds_t))));
d_vdj2_dV_bi_ei = (deriv_log_0_d0*((-(d_vj2_dV_bi_ei/vds_t))));
d_vdj2_dV_ci_ei = (deriv_log_0_d0*((-(d_vj2_dV_ci_ei/vds_t))));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;

d_qj1_dV_b_ci = (cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ez)))/ez);
d_qj1_dV_bi_ci = (cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ez)))/ez);
d_qj1_dV_s_ci = (cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_s_ci*ez)))/ez);
d_qj1_dV_bi_ei = (cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ei*ez)))/ez);
d_qj1_dV_ci_ei = (cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_ci_ei*ez)))/ez);
d_qj1_dV_tnode_GND = ((cjs0_t*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ez)))+d_cjs0_t_dV_tnode_GND*(1.0-value_exp_0))/ez);
qj1 = ((cjs0_t*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj2_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_b_ci*ezr)))/ezr);
d_qj2_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_bi_ci*ezr)))/ezr);
d_qj2_dV_s_ci = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_s_ci*ezr)))/ezr);
d_qj2_dV_bi_ei = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_bi_ei*ezr)))/ezr);
d_qj2_dV_ci_ei = (cr*(-(deriv_exp_0_d0*(d_vdj1_dV_ci_ei*ezr)))/ezr);
d_qj2_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj1_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;

d_qj3_dV_b_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_b_ci*ezr)))/ezr);
d_qj3_dV_bi_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ci*ezr)))/ezr);
d_qj3_dV_s_ci = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_s_ci*ezr)))/ezr);
d_qj3_dV_bi_ei = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_bi_ei*ezr)))/ezr);
d_qj3_dV_ci_ei = (cr*(-(deriv_exp_0_d0*(d_vdj2_dV_ci_ei*ezr)))/ezr);
d_qj3_dV_tnode_GND = ((cr*(-(deriv_exp_0_d0*(d_vdj2_dV_tnode_GND*ezr)))+d_cr_dV_tnode_GND*(1.0-value_exp_0))/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}

d_qjs_dV_b_ci = (((d_qj1_dV_b_ci+d_qj2_dV_b_ci)-d_qj3_dV_b_ci)*vds_t+cmax*d_vj4_dV_b_ci);
d_qjs_dV_tnode_GND = ((((qj1+qj2)-qj3)*d_vds_t_dV_tnode_GND+((d_qj1_dV_tnode_GND+d_qj2_dV_tnode_GND)-d_qj3_dV_tnode_GND)*vds_t)+(cmax*d_vj4_dV_tnode_GND+d_cmax_dV_tnode_GND*vj4));
d_qjs_dV_bi_ci = (((d_qj1_dV_bi_ci+d_qj2_dV_bi_ci)-d_qj3_dV_bi_ci)*vds_t+cmax*d_vj4_dV_bi_ci);
d_qjs_dV_s_ci = (((d_qj1_dV_s_ci+d_qj2_dV_s_ci)-d_qj3_dV_s_ci)*vds_t+cmax*d_vj4_dV_s_ci);
d_qjs_dV_bi_ei = (((d_qj1_dV_bi_ei+d_qj2_dV_bi_ei)-d_qj3_dV_bi_ei)*vds_t+cmax*d_vj4_dV_bi_ei);
d_qjs_dV_ci_ei = (((d_qj1_dV_ci_ei+d_qj2_dV_ci_ei)-d_qj3_dV_ci_ei)*vds_t+cmax*d_vj4_dV_ci_ei);
qjs = ((((qj1+qj2)-qj3)*vds_t)+(cmax*vj4));
}
else
{

d_qjs_dV_ci_ei = d_qjs_dV_bi_ei = d_qjs_dV_s_ci = d_qjs_dV_bi_ci = d_qjs_dV_tnode_GND = d_qjs_dV_b_ci =  0.0;
qjs = 0.0;
}
}
else
{
if ((cjs0_t>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/(model_.zs)));

d_vf_dV_tnode_GND = d_vds_t_dV_tnode_GND*(1.0-value_exp_1);
vf = (vds_t*(1.0-value_exp_1));
}

d_xvf_dV_bi_ei = d_xvf_dV_bi_ci = d_xvf_dV_b_ci =  0.0;
d_xvf_dV_s_ci = ((-d_Vsci_dV_s_ci)/VT);
d_xvf_dV_tnode_GND = ((VT*d_vf_dV_tnode_GND-(vf-Vsci)*d_VT_dV_tnode_GND)/VT/VT);
xvf = ((vf-Vsci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

d_xvf2_dV_b_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_b_ci+d_xvf_dV_b_ci*xvf)));
d_xvf2_dV_tnode_GND = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_tnode_GND+d_xvf_dV_tnode_GND*xvf)));
d_xvf2_dV_bi_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ci+d_xvf_dV_bi_ci*xvf)));
d_xvf2_dV_bi_ei = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_bi_ei+d_xvf_dV_bi_ei*xvf)));
d_xvf2_dV_s_ci = (deriv_sqrt_0_d0*((xvf*d_xvf_dV_s_ci+d_xvf_dV_s_ci*xvf)));
xvf2 = value_sqrt_0;
}

d_v_j_dV_b_ci = (-VT*(d_xvf_dV_b_ci+d_xvf2_dV_b_ci)*0.5);
d_v_j_dV_bi_ci = (-VT*(d_xvf_dV_bi_ci+d_xvf2_dV_bi_ci)*0.5);
d_v_j_dV_bi_ei = (-VT*(d_xvf_dV_bi_ei+d_xvf2_dV_bi_ei)*0.5);
d_v_j_dV_s_ci = (-VT*(d_xvf_dV_s_ci+d_xvf2_dV_s_ci)*0.5);
d_v_j_dV_tnode_GND = (d_vf_dV_tnode_GND-(VT*(d_xvf_dV_tnode_GND+d_xvf2_dV_tnode_GND)+d_VT_dV_tnode_GND*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));

d_x_dV_tnode_GND = d_x_dV_ci_ei =  0.0;
x = (1.0-(model_.zs));
{
double value_log_0 = log((1.0-(v_j/vds_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vds_t)));
double  deriv_exp_1_d0 = value_exp_1;

d_y_dV_b_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_b_ci/vds_t)))))));
d_y_dV_bi_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ci/vds_t)))))));
d_y_dV_bi_ei = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_bi_ei/vds_t)))))));
d_y_dV_s_ci = (-(deriv_exp_1_d0*(x*(deriv_log_0_d0*((-(d_v_j_dV_s_ci/vds_t)))))));
d_y_dV_ci_ei = (-(deriv_exp_1_d0*(d_x_dV_ci_ei*value_log_0)));
d_y_dV_tnode_GND = (-(deriv_exp_1_d0*((x*(deriv_log_0_d0*((-((vds_t*d_v_j_dV_tnode_GND-v_j*d_vds_t_dV_tnode_GND)/vds_t/vds_t))))+d_x_dV_tnode_GND*value_log_0))));
y = (1.0-value_exp_1);
}

d_qjs_dV_b_ci = (((cjs0_t*vds_t)*d_y_dV_b_ci/x)+(2.4*cjs0_t)*(-d_v_j_dV_b_ci));
d_qjs_dV_bi_ci = (((cjs0_t*vds_t)*d_y_dV_bi_ci/x)+(2.4*cjs0_t)*(-d_v_j_dV_bi_ci));
d_qjs_dV_bi_ei = (((cjs0_t*vds_t)*d_y_dV_bi_ei/x)+(2.4*cjs0_t)*(-d_v_j_dV_bi_ei));
d_qjs_dV_ci_ei = ((x*(cjs0_t*vds_t)*d_y_dV_ci_ei-((cjs0_t*vds_t)*y)*d_x_dV_ci_ei)/x/x);
d_qjs_dV_s_ci = (((cjs0_t*vds_t)*d_y_dV_s_ci/x)+(2.4*cjs0_t)*(d_Vsci_dV_s_ci-d_v_j_dV_s_ci));
d_qjs_dV_tnode_GND = (((x*((cjs0_t*vds_t)*d_y_dV_tnode_GND+(cjs0_t*d_vds_t_dV_tnode_GND+d_cjs0_t_dV_tnode_GND*vds_t)*y)-((cjs0_t*vds_t)*y)*d_x_dV_tnode_GND)/x/x)+((2.4*cjs0_t)*(-d_v_j_dV_tnode_GND)+2.4*d_cjs0_t_dV_tnode_GND*(Vsci-v_j)));
qjs = ((((cjs0_t*vds_t)*y)/x)+((2.4*cjs0_t)*(Vsci-v_j)));
}
else
{

d_qjs_dV_ci_ei = d_qjs_dV_bi_ei = d_qjs_dV_s_ci = d_qjs_dV_bi_ci = d_qjs_dV_tnode_GND = d_qjs_dV_b_ci =  0.0;
qjs = 0.00;
}
}

d_pterm_dV_ci_c = d_pterm_dV_ei_e = d_pterm_dV_b_bi = d_pterm_dV_s_ci = d_pterm_dV_tnode_GND = d_pterm_dV_bi_ei = d_pterm_dV_bi_ci = d_pterm_dV_b_ci = d_pterm_dV_ci_ei =  0.0;
pterm = 0;
if ((((model_.flsh)==1)&&((model_.rth)>=0.001)))
{

d_pterm_dV_ci_c = d_pterm_dV_ei_e = d_pterm_dV_b_bi = d_pterm_dV_s_ci =  0.0;
d_pterm_dV_ci_ei = ((it*d_Vciei_dV_ci_ei+d_it_dV_ci_ei*Vciei)+d_iavl_dV_ci_ei*(vdci_t-Vbici));
d_pterm_dV_b_ci = (d_it_dV_b_ci*Vciei+d_iavl_dV_b_ci*(vdci_t-Vbici));
d_pterm_dV_bi_ci = (d_it_dV_bi_ci*Vciei+(iavl*(-d_Vbici_dV_bi_ci)+d_iavl_dV_bi_ci*(vdci_t-Vbici)));
d_pterm_dV_bi_ei = (d_it_dV_bi_ei*Vciei+d_iavl_dV_bi_ei*(vdci_t-Vbici));
d_pterm_dV_tnode_GND = (d_it_dV_tnode_GND*Vciei+(iavl*d_vdci_t_dV_tnode_GND+d_iavl_dV_tnode_GND*(vdci_t-Vbici)));
pterm = ((it*Vciei)+(iavl*(vdci_t-Vbici)));
}
else
{
if ((((model_.flsh)==2)&&((model_.rth)>=0.001)))
{

d_pterm_dV_ci_c = d_pterm_dV_ei_e = d_pterm_dV_b_bi =  0.0;
d_pterm_dV_s_ci = (ijsc*d_Vsci_dV_s_ci+d_ijsc_dV_s_ci*Vsci);
d_pterm_dV_b_ci = (Vciei*d_it_dV_b_ci+(vdci_t-Vbici)*d_iavl_dV_b_ci);
d_pterm_dV_bi_ci = (((Vciei*d_it_dV_bi_ci+((vdci_t-Vbici)*d_iavl_dV_bi_ci+(-d_Vbici_dV_bi_ci)*iavl))+(ijbc*d_Vbici_dV_bi_ci+d_ijbc_dV_bi_ci*Vbici))+d_ijsc_dV_bi_ci*Vsci);
d_pterm_dV_bi_ei = ((((Vciei*d_it_dV_bi_ei+(vdci_t-Vbici)*d_iavl_dV_bi_ei)+(ijbe*d_Vbiei_dV_bi_ei+d_ijbe_dV_bi_ei*Vbiei))+d_ijbc_dV_bi_ei*Vbici)+d_ijsc_dV_bi_ei*Vsci);
d_pterm_dV_tnode_GND = ((((Vciei*d_it_dV_tnode_GND+((vdci_t-Vbici)*d_iavl_dV_tnode_GND+d_vdci_t_dV_tnode_GND*iavl))+d_ijbe_dV_tnode_GND*Vbiei)+d_ijbc_dV_tnode_GND*Vbici)+d_ijsc_dV_tnode_GND*Vsci);
d_pterm_dV_ci_ei = ((Vciei*d_it_dV_ci_ei+d_Vciei_dV_ci_ei*it)+(vdci_t-Vbici)*d_iavl_dV_ci_ei);
pterm = (((((Vciei*it)+((vdci_t-Vbici)*iavl))+(ijbe*Vbiei))+(ijbc*Vbici))+(ijsc*Vsci));
if ((rb>=0.001))
{

d_pterm_dV_ci_c = d_pterm_dV_ei_e =  0.0;
d_pterm_dV_b_bi = (d_pterm_dV_b_bi+((Vbbi*d_Vbbi_dV_b_bi+d_Vbbi_dV_b_bi*Vbbi)/rb));
d_pterm_dV_ci_ei = (d_pterm_dV_ci_ei+(-(Vbbi*Vbbi)*d_rb_dV_ci_ei/rb/rb));
d_pterm_dV_b_ci = (d_pterm_dV_b_ci+(-(Vbbi*Vbbi)*d_rb_dV_b_ci/rb/rb));
d_pterm_dV_bi_ci = (d_pterm_dV_bi_ci+(-(Vbbi*Vbbi)*d_rb_dV_bi_ci/rb/rb));
d_pterm_dV_bi_ei = (d_pterm_dV_bi_ei+(-(Vbbi*Vbbi)*d_rb_dV_bi_ei/rb/rb));
d_pterm_dV_tnode_GND = (d_pterm_dV_tnode_GND+(-(Vbbi*Vbbi)*d_rb_dV_tnode_GND/rb/rb));
pterm = (pterm+((Vbbi*Vbbi)/rb));
}
if (((model_.re)>=0.001))
{

d_pterm_dV_ci_c =  0.0;
d_pterm_dV_ei_e = (d_pterm_dV_ei_e+((Veie*d_Veie_dV_ei_e+d_Veie_dV_ei_e*Veie)/re_t));
d_pterm_dV_tnode_GND = (d_pterm_dV_tnode_GND+(-(Veie*Veie)*d_re_t_dV_tnode_GND/re_t/re_t));
pterm = (pterm+((Veie*Veie)/re_t));
}
if (((model_.rcx)>=0.001))
{

d_pterm_dV_ci_c = (d_pterm_dV_ci_c+((Vcic*d_Vcic_dV_ci_c+d_Vcic_dV_ci_c*Vcic)/rcx_t));
d_pterm_dV_tnode_GND = (d_pterm_dV_tnode_GND+(-(Vcic*Vcic)*d_rcx_t_dV_tnode_GND/rcx_t/rcx_t));
pterm = (pterm+((Vcic*Vcic)/rcx_t));
}
}
}

d_Itxf_dV_xf2_GND =  0.0;
d_Itxf_dV_ci_ei = d_itf_dV_ci_ei;
d_Itxf_dV_b_ci = d_itf_dV_b_ci;
d_Itxf_dV_bi_ci = d_itf_dV_bi_ci;
d_Itxf_dV_bi_ei = d_itf_dV_bi_ei;
d_Itxf_dV_tnode_GND = d_itf_dV_tnode_GND;
Itxf = itf;

d_Qdeix_dV_xf_GND =  0.0;
d_Qdeix_dV_ci_ei = d_qf_dV_ci_ei;
d_Qdeix_dV_bi_ei = d_qf_dV_bi_ei;
d_Qdeix_dV_b_ci = d_qf_dV_b_ci;
d_Qdeix_dV_bi_ci = d_qf_dV_bi_ci;
d_Qdeix_dV_tnode_GND = d_qf_dV_tnode_GND;
Qdeix = qf;
if ((((model_.flnqs)!=0)&&(tf!=0)))
{

d_Vxf1_dV_xf1_GND = d_probeVars[admsProbeID_V_xf1_GND][admsProbeID_V_xf1_GND];
Vxf1 = (probeVars[admsProbeID_V_xf1_GND]);

d_Vxf2_dV_xf2_GND = d_probeVars[admsProbeID_V_xf2_GND][admsProbeID_V_xf2_GND];
Vxf2 = (probeVars[admsProbeID_V_xf2_GND]);

d_Ixf1_dV_xf1_GND =  0.0;
d_Ixf1_dV_ci_ei = ((tf*(-d_itf_dV_ci_ei)-(Vxf2-itf)*d_tf_dV_ci_ei)/tf/tf)*(model_.t0);
d_Ixf1_dV_b_ci = ((tf*(-d_itf_dV_b_ci)-(Vxf2-itf)*d_tf_dV_b_ci)/tf/tf)*(model_.t0);
d_Ixf1_dV_bi_ci = ((tf*(-d_itf_dV_bi_ci)-(Vxf2-itf)*d_tf_dV_bi_ci)/tf/tf)*(model_.t0);
d_Ixf1_dV_bi_ei = ((tf*(-d_itf_dV_bi_ei)-(Vxf2-itf)*d_tf_dV_bi_ei)/tf/tf)*(model_.t0);
d_Ixf1_dV_tnode_GND = ((tf*(-d_itf_dV_tnode_GND)-(Vxf2-itf)*d_tf_dV_tnode_GND)/tf/tf)*(model_.t0);
d_Ixf1_dV_xf2_GND = (d_Vxf2_dV_xf2_GND/tf)*(model_.t0);
Ixf1 = (((Vxf2-itf)/tf)*(model_.t0));

d_Ixf2_dV_bi_ei = (-(Vxf2-Vxf1)*d_tf_dV_bi_ei/tf/tf)*(model_.t0);
d_Ixf2_dV_ci_ei = (-(Vxf2-Vxf1)*d_tf_dV_ci_ei/tf/tf)*(model_.t0);
d_Ixf2_dV_b_ci = (-(Vxf2-Vxf1)*d_tf_dV_b_ci/tf/tf)*(model_.t0);
d_Ixf2_dV_bi_ci = (-(Vxf2-Vxf1)*d_tf_dV_bi_ci/tf/tf)*(model_.t0);
d_Ixf2_dV_tnode_GND = (-(Vxf2-Vxf1)*d_tf_dV_tnode_GND/tf/tf)*(model_.t0);
d_Ixf2_dV_xf1_GND = ((-d_Vxf1_dV_xf1_GND)/tf)*(model_.t0);
d_Ixf2_dV_xf2_GND = (d_Vxf2_dV_xf2_GND/tf)*(model_.t0);
Ixf2 = (((Vxf2-Vxf1)/tf)*(model_.t0));

d_Qxf1_dV_xf1_GND = (model_.alit)*d_Vxf1_dV_xf1_GND*(model_.t0);
Qxf1 = (((model_.alit)*Vxf1)*(model_.t0));

d_Qxf2_dV_xf2_GND = ((model_.alit)*d_Vxf2_dV_xf2_GND/3)*(model_.t0);
Qxf2 = ((((model_.alit)*Vxf2)/3)*(model_.t0));

d_Itxf_dV_tnode_GND = d_Itxf_dV_bi_ei = d_Itxf_dV_bi_ci = d_Itxf_dV_b_ci = d_Itxf_dV_ci_ei =  0.0;
d_Itxf_dV_xf2_GND = d_Vxf2_dV_xf2_GND;
Itxf = Vxf2;

d_Vxf_dV_xf_GND = d_probeVars[admsProbeID_V_xf_GND][admsProbeID_V_xf_GND];
Vxf = (probeVars[admsProbeID_V_xf_GND]);

d_fact_dV_bi_ei = (-(model_.t0)*d_tf_dV_bi_ei/tf/tf);
d_fact_dV_ci_ei = (-(model_.t0)*d_tf_dV_ci_ei/tf/tf);
d_fact_dV_b_ci = (-(model_.t0)*d_tf_dV_b_ci/tf/tf);
d_fact_dV_bi_ci = (-(model_.t0)*d_tf_dV_bi_ci/tf/tf);
d_fact_dV_tnode_GND = (-(model_.t0)*d_tf_dV_tnode_GND/tf/tf);
fact = ((model_.t0)/tf);

d_Ixf_dV_ci_ei = ((Vxf-qf)*d_fact_dV_ci_ei+(-d_qf_dV_ci_ei)*fact);
d_Ixf_dV_bi_ei = ((Vxf-qf)*d_fact_dV_bi_ei+(-d_qf_dV_bi_ei)*fact);
d_Ixf_dV_b_ci = ((Vxf-qf)*d_fact_dV_b_ci+(-d_qf_dV_b_ci)*fact);
d_Ixf_dV_bi_ci = ((Vxf-qf)*d_fact_dV_bi_ci+(-d_qf_dV_bi_ci)*fact);
d_Ixf_dV_tnode_GND = ((Vxf-qf)*d_fact_dV_tnode_GND+(-d_qf_dV_tnode_GND)*fact);
d_Ixf_dV_xf_GND = d_Vxf_dV_xf_GND*fact;
Ixf = ((Vxf-qf)*fact);

d_Qxf_dV_xf_GND = (model_.alqf)*d_Vxf_dV_xf_GND*(model_.t0);
Qxf = (((model_.alqf)*Vxf)*(model_.t0));

d_Qdeix_dV_tnode_GND = d_Qdeix_dV_bi_ci = d_Qdeix_dV_b_ci = d_Qdeix_dV_bi_ei = d_Qdeix_dV_ci_ei =  0.0;
d_Qdeix_dV_xf_GND = d_Vxf_dV_xf_GND;
Qdeix = Vxf;
}
else
{

d_Ixf1_dV_xf2_GND = d_Ixf1_dV_tnode_GND = d_Ixf1_dV_bi_ei = d_Ixf1_dV_bi_ci = d_Ixf1_dV_b_ci = d_Ixf1_dV_ci_ei =  0.0;
d_Ixf1_dV_xf1_GND = d_probeVars[admsProbeID_V_xf1_GND][admsProbeID_V_xf1_GND];
Ixf1 = (probeVars[admsProbeID_V_xf1_GND]);

d_Ixf2_dV_xf1_GND = d_Ixf2_dV_tnode_GND = d_Ixf2_dV_bi_ci = d_Ixf2_dV_b_ci = d_Ixf2_dV_ci_ei = d_Ixf2_dV_bi_ei =  0.0;
d_Ixf2_dV_xf2_GND = d_probeVars[admsProbeID_V_xf2_GND][admsProbeID_V_xf2_GND];
Ixf2 = (probeVars[admsProbeID_V_xf2_GND]);

d_Qxf1_dV_xf1_GND =  0.0;
Qxf1 = 0;

d_Qxf2_dV_xf2_GND =  0.0;
Qxf2 = 0;

d_Ixf_dV_tnode_GND = d_Ixf_dV_bi_ci = d_Ixf_dV_b_ci = d_Ixf_dV_bi_ei = d_Ixf_dV_ci_ei =  0.0;
d_Ixf_dV_xf_GND = d_probeVars[admsProbeID_V_xf_GND][admsProbeID_V_xf_GND];
Ixf = (probeVars[admsProbeID_V_xf_GND]);

d_Qxf_dV_xf_GND =  0.0;
Qxf = 0;
}

d_Ibici_dV_ci_ei = (-d_iavl_dV_ci_ei);
d_Ibici_dV_b_ci = (-d_iavl_dV_b_ci);
d_Ibici_dV_bi_ei = (d_ijbc_dV_bi_ei-d_iavl_dV_bi_ei);
d_Ibici_dV_bi_ci = (d_ijbc_dV_bi_ci-d_iavl_dV_bi_ci);
d_Ibici_dV_tnode_GND = (d_ijbc_dV_tnode_GND-d_iavl_dV_tnode_GND);
Ibici = (ijbc-iavl);

d_Qbci_dV_b_ci = (model_.cbcpar)*d_Vbci_dV_b_ci;
Qbci = ((model_.cbcpar)*Vbci);

d_Qbe_dV_b_e = (model_.cbepar)*d_Vbe_dV_b_e;
Qbe = ((model_.cbepar)*Vbe);

d_Qbici_dV_ci_ei = d_qr_dV_ci_ei;
d_Qbici_dV_bi_ei = d_qr_dV_bi_ei;
d_Qbici_dV_b_ci = (d_qjcii_dV_b_ci+d_qr_dV_b_ci);
d_Qbici_dV_tnode_GND = (d_qjcii_dV_tnode_GND+d_qr_dV_tnode_GND);
d_Qbici_dV_bi_ci = (d_qjcii_dV_bi_ci+d_qr_dV_bi_ci);
Qbici = (qjcii+qr);

d_Qbiei_dV_xf_GND = d_Qdeix_dV_xf_GND;
d_Qbiei_dV_b_ci = (d_qjei_dV_b_ci+d_Qdeix_dV_b_ci);
d_Qbiei_dV_bi_ci = (d_qjei_dV_bi_ci+d_Qdeix_dV_bi_ci);
d_Qbiei_dV_bi_ei = (d_qjei_dV_bi_ei+d_Qdeix_dV_bi_ei);
d_Qbiei_dV_ci_ei = (d_qjei_dV_ci_ei+d_Qdeix_dV_ci_ei);
d_Qbiei_dV_tnode_GND = (d_qjei_dV_tnode_GND+d_Qdeix_dV_tnode_GND);
Qbiei = (qjei+Qdeix);

d_ijsc_dV_bi_ei = HICUMtype*d_ijsc_dV_bi_ei;
d_ijsc_dV_bi_ci = HICUMtype*d_ijsc_dV_bi_ci;
d_ijsc_dV_s_ci = HICUMtype*d_ijsc_dV_s_ci;
d_ijsc_dV_tnode_GND = HICUMtype*d_ijsc_dV_tnode_GND;
ijsc = (HICUMtype*ijsc);

d_qjs_dV_b_ci = HICUMtype*d_qjs_dV_b_ci;
d_qjs_dV_tnode_GND = HICUMtype*d_qjs_dV_tnode_GND;
d_qjs_dV_bi_ci = HICUMtype*d_qjs_dV_bi_ci;
d_qjs_dV_s_ci = HICUMtype*d_qjs_dV_s_ci;
d_qjs_dV_bi_ei = HICUMtype*d_qjs_dV_bi_ei;
d_qjs_dV_ci_ei = HICUMtype*d_qjs_dV_ci_ei;
qjs = (HICUMtype*qjs);

d_qjcx_dV_b_ci = HICUMtype*d_qjcx_dV_b_ci;
d_qjcx_dV_tnode_GND = HICUMtype*d_qjcx_dV_tnode_GND;
d_qjcx_dV_bi_ci = HICUMtype*d_qjcx_dV_bi_ci;
qjcx = (HICUMtype*qjcx);

d_Qbci_dV_b_ci = HICUMtype*d_Qbci_dV_b_ci;
Qbci = (HICUMtype*Qbci);

d_Qbe_dV_b_e = HICUMtype*d_Qbe_dV_b_e;
Qbe = (HICUMtype*Qbe);

d_Ibici_dV_ci_ei = HICUMtype*d_Ibici_dV_ci_ei;
d_Ibici_dV_b_ci = HICUMtype*d_Ibici_dV_b_ci;
d_Ibici_dV_bi_ei = HICUMtype*d_Ibici_dV_bi_ei;
d_Ibici_dV_bi_ci = HICUMtype*d_Ibici_dV_bi_ci;
d_Ibici_dV_tnode_GND = HICUMtype*d_Ibici_dV_tnode_GND;
Ibici = (HICUMtype*Ibici);

d_Qbici_dV_ci_ei = HICUMtype*d_Qbici_dV_ci_ei;
d_Qbici_dV_bi_ei = HICUMtype*d_Qbici_dV_bi_ei;
d_Qbici_dV_b_ci = HICUMtype*d_Qbici_dV_b_ci;
d_Qbici_dV_tnode_GND = HICUMtype*d_Qbici_dV_tnode_GND;
d_Qbici_dV_bi_ci = HICUMtype*d_Qbici_dV_bi_ci;
Qbici = (HICUMtype*Qbici);

d_ijbe_dV_bi_ei = HICUMtype*d_ijbe_dV_bi_ei;
d_ijbe_dV_tnode_GND = HICUMtype*d_ijbe_dV_tnode_GND;
ijbe = (HICUMtype*ijbe);

d_Qbiei_dV_xf_GND = HICUMtype*d_Qbiei_dV_xf_GND;
d_Qbiei_dV_b_ci = HICUMtype*d_Qbiei_dV_b_ci;
d_Qbiei_dV_bi_ci = HICUMtype*d_Qbiei_dV_bi_ci;
d_Qbiei_dV_bi_ei = HICUMtype*d_Qbiei_dV_bi_ei;
d_Qbiei_dV_ci_ei = HICUMtype*d_Qbiei_dV_ci_ei;
d_Qbiei_dV_tnode_GND = HICUMtype*d_Qbiei_dV_tnode_GND;
Qbiei = (HICUMtype*Qbiei);

d_it_wop_dV_ci_ei = HICUMtype*d_it_dV_ci_ei;
d_it_wop_dV_b_ci = HICUMtype*d_it_dV_b_ci;
d_it_wop_dV_bi_ci = HICUMtype*d_it_dV_bi_ci;
d_it_wop_dV_bi_ei = HICUMtype*d_it_dV_bi_ei;
d_it_wop_dV_tnode_GND = HICUMtype*d_it_dV_tnode_GND;
it_wop = (HICUMtype*it);

d_it_dV_ci_ei = HICUMtype*(d_Itxf_dV_ci_ei-d_itr_dV_ci_ei);
d_it_dV_b_ci = HICUMtype*(d_Itxf_dV_b_ci-d_itr_dV_b_ci);
d_it_dV_bi_ci = HICUMtype*(d_Itxf_dV_bi_ci-d_itr_dV_bi_ci);
d_it_dV_bi_ei = HICUMtype*(d_Itxf_dV_bi_ei-d_itr_dV_bi_ei);
d_it_dV_tnode_GND = HICUMtype*(d_Itxf_dV_tnode_GND-d_itr_dV_tnode_GND);
d_it_dV_xf2_GND = HICUMtype*d_Itxf_dV_xf2_GND;
it = (HICUMtype*(Itxf-itr));

d_iavl_dV_ci_ei = HICUMtype*d_iavl_dV_ci_ei;
d_iavl_dV_b_ci = HICUMtype*d_iavl_dV_b_ci;
d_iavl_dV_bi_ci = HICUMtype*d_iavl_dV_bi_ci;
d_iavl_dV_bi_ei = HICUMtype*d_iavl_dV_bi_ei;
d_iavl_dV_tnode_GND = HICUMtype*d_iavl_dV_tnode_GND;
iavl = (HICUMtype*iavl);
// I(bi,ei) <+ (($simparam("gmin",1e-12)*V(bi,ei)))
staticContributions[admsNodeID_bi] += (getDeviceOptions().gmin*(probeVars[admsProbeID_V_bi_ei]));
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei] += getDeviceOptions().gmin*d_probeVars[admsProbeID_V_bi_ei][admsProbeID_V_bi_ei];
staticContributions[admsNodeID_ei] -= (getDeviceOptions().gmin*(probeVars[admsProbeID_V_bi_ei]));
d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei] -= getDeviceOptions().gmin*d_probeVars[admsProbeID_V_bi_ei][admsProbeID_V_bi_ei];
// I(bi,ci) <+ (($simparam("gmin",1e-12)*V(bi,ci)))
staticContributions[admsNodeID_bi] += (getDeviceOptions().gmin*(probeVars[admsProbeID_V_bi_ci]));
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += getDeviceOptions().gmin*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
staticContributions[admsNodeID_ci] -= (getDeviceOptions().gmin*(probeVars[admsProbeID_V_bi_ci]));
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= getDeviceOptions().gmin*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
// I(ci,ei) <+ (($simparam("gmin",1e-12)*V(ci,ei)))
staticContributions[admsNodeID_ci] += (getDeviceOptions().gmin*(probeVars[admsProbeID_V_ci_ei]));
d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] += getDeviceOptions().gmin*d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei];
staticContributions[admsNodeID_ei] -= (getDeviceOptions().gmin*(probeVars[admsProbeID_V_ci_ei]));
d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -= getDeviceOptions().gmin*d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei];
// I(b,s) <+ ((HICUMtype*HSI_Tsu))
staticContributions[admsNodeID_b] += (HICUMtype*HSI_Tsu);
d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci] += HICUMtype*d_HSI_Tsu_dV_s_ci;
d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci] += HICUMtype*d_HSI_Tsu_dV_b_ci;
d_staticContributions[admsNodeID_b][admsProbeID_V_tnode_GND] += HICUMtype*d_HSI_Tsu_dV_tnode_GND;
staticContributions[admsNodeID_s] -= (HICUMtype*HSI_Tsu);
d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci] -= HICUMtype*d_HSI_Tsu_dV_s_ci;
d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci] -= HICUMtype*d_HSI_Tsu_dV_b_ci;
d_staticContributions[admsNodeID_s][admsProbeID_V_tnode_GND] -= HICUMtype*d_HSI_Tsu_dV_tnode_GND;
// I(s,ci) <+ (ijsc)
staticContributions[admsNodeID_s] += ijsc;
d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei] += d_ijsc_dV_bi_ei;
d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] += d_ijsc_dV_bi_ci;
d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci] += d_ijsc_dV_s_ci;
d_staticContributions[admsNodeID_s][admsProbeID_V_tnode_GND] += d_ijsc_dV_tnode_GND;
staticContributions[admsNodeID_ci] -= ijsc;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -= d_ijsc_dV_bi_ei;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= d_ijsc_dV_bi_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci] -= d_ijsc_dV_s_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] -= d_ijsc_dV_tnode_GND;
// I(s,ci) <+ (ddt(qjs))
dynamicContributions[admsNodeID_s] += (qjs);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci] += (d_qjs_dV_b_ci);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_tnode_GND] += (d_qjs_dV_tnode_GND);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci] += (d_qjs_dV_bi_ci);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci] += (d_qjs_dV_s_ci);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei] += (d_qjs_dV_bi_ei);
d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] += (d_qjs_dV_ci_ei);
dynamicContributions[admsNodeID_ci] -= (qjs);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci] -= (d_qjs_dV_b_ci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] -= (d_qjs_dV_tnode_GND);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= (d_qjs_dV_bi_ci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci] -= (d_qjs_dV_s_ci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -= (d_qjs_dV_bi_ei);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -= (d_qjs_dV_ci_ei);
// I(b,ci) <+ (ddt(qjcx))
dynamicContributions[admsNodeID_b] += (qjcx);
d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci] += (d_qjcx_dV_b_ci);
d_dynamicContributions[admsNodeID_b][admsProbeID_V_tnode_GND] += (d_qjcx_dV_tnode_GND);
d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci] += (d_qjcx_dV_bi_ci);
dynamicContributions[admsNodeID_ci] -= (qjcx);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci] -= (d_qjcx_dV_b_ci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] -= (d_qjcx_dV_tnode_GND);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= (d_qjcx_dV_bi_ci);
// I(b,ci) <+ (ddt(Qbci))
dynamicContributions[admsNodeID_b] += (Qbci);
d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci] += (d_Qbci_dV_b_ci);
dynamicContributions[admsNodeID_ci] -= (Qbci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci] -= (d_Qbci_dV_b_ci);
// I(b,e) <+ (ddt(Qbe))
dynamicContributions[admsNodeID_b] += (Qbe);
d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e] += (d_Qbe_dV_b_e);
dynamicContributions[admsNodeID_e] -= (Qbe);
d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e] -= (d_Qbe_dV_b_e);
if (((model_.re)>=0.001))
{
// I(ei,e) <+ ((Veie/re_t))
staticContributions[admsNodeID_ei] += (Veie/re_t);
d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] += (-Veie*d_re_t_dV_tnode_GND/re_t/re_t);
d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e] += (d_Veie_dV_ei_e/re_t);
staticContributions[admsNodeID_e] -= (Veie/re_t);
d_staticContributions[admsNodeID_e][admsProbeID_V_tnode_GND] -= (-Veie*d_re_t_dV_tnode_GND/re_t/re_t);
d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e] -= (d_Veie_dV_ei_e/re_t);
}
else
{
// V(ei,e) <+ (0.0)
// do nothing at all
}
if (((model_.rcx)>=0.001))
{
// I(ci,c) <+ ((Vcic/rcx_t))
staticContributions[admsNodeID_ci] += (Vcic/rcx_t);
d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] += (-Vcic*d_rcx_t_dV_tnode_GND/rcx_t/rcx_t);
d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c] += (d_Vcic_dV_ci_c/rcx_t);
staticContributions[admsNodeID_c] -= (Vcic/rcx_t);
d_staticContributions[admsNodeID_c][admsProbeID_V_tnode_GND] -= (-Vcic*d_rcx_t_dV_tnode_GND/rcx_t/rcx_t);
d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c] -= (d_Vcic_dV_ci_c/rcx_t);
}
else
{
// V(ci,c) <+ (0.0)
// do nothing at all
}
if ((((model_.rbi0)>=0.001)||((model_.rbx)>=0.001)))
{
// I(b,bi) <+ ((Vbbi/rb))
staticContributions[admsNodeID_b] += (Vbbi/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci] += (-Vbbi*d_rb_dV_b_ci/rb/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci] += (-Vbbi*d_rb_dV_bi_ci/rb/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei] += (-Vbbi*d_rb_dV_ci_ei/rb/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] += (-Vbbi*d_rb_dV_bi_ei/rb/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_tnode_GND] += (-Vbbi*d_rb_dV_tnode_GND/rb/rb);
d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] += (d_Vbbi_dV_b_bi/rb);
staticContributions[admsNodeID_bi] -= (Vbbi/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci] -= (-Vbbi*d_rb_dV_b_ci/rb/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] -= (-Vbbi*d_rb_dV_bi_ci/rb/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] -= (-Vbbi*d_rb_dV_ci_ei/rb/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei] -= (-Vbbi*d_rb_dV_bi_ei/rb/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] -= (-Vbbi*d_rb_dV_tnode_GND/rb/rb);
d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] -= (d_Vbbi_dV_b_bi/rb);
}
else
{
// V(b,bi) <+ (0.0)
// do nothing at all
}
// I(bi,ci) <+ (Ibici)
staticContributions[admsNodeID_bi] += Ibici;
d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] += d_Ibici_dV_ci_ei;
d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci] += d_Ibici_dV_b_ci;
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei] += d_Ibici_dV_bi_ei;
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += d_Ibici_dV_bi_ci;
d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] += d_Ibici_dV_tnode_GND;
staticContributions[admsNodeID_ci] -= Ibici;
d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -= d_Ibici_dV_ci_ei;
d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci] -= d_Ibici_dV_b_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -= d_Ibici_dV_bi_ei;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= d_Ibici_dV_bi_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] -= d_Ibici_dV_tnode_GND;
// I(bi,ci) <+ (ddt(Qbici))
dynamicContributions[admsNodeID_bi] += (Qbici);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei] += (d_Qbici_dV_ci_ei);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei] += (d_Qbici_dV_bi_ei);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci] += (d_Qbici_dV_b_ci);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] += (d_Qbici_dV_tnode_GND);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += (d_Qbici_dV_bi_ci);
dynamicContributions[admsNodeID_ci] -= (Qbici);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -= (d_Qbici_dV_ci_ei);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -= (d_Qbici_dV_bi_ei);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci] -= (d_Qbici_dV_b_ci);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] -= (d_Qbici_dV_tnode_GND);
d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= (d_Qbici_dV_bi_ci);
// I(bi,ei) <+ (ijbe)
staticContributions[admsNodeID_bi] += ijbe;
d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei] += d_ijbe_dV_bi_ei;
d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] += d_ijbe_dV_tnode_GND;
staticContributions[admsNodeID_ei] -= ijbe;
d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei] -= d_ijbe_dV_bi_ei;
d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] -= d_ijbe_dV_tnode_GND;
// I(bi,ei) <+ (ddt(Qbiei))
dynamicContributions[admsNodeID_bi] += (Qbiei);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf_GND] += (d_Qbiei_dV_xf_GND);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci] += (d_Qbiei_dV_b_ci);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += (d_Qbiei_dV_bi_ci);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei] += (d_Qbiei_dV_bi_ei);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei] += (d_Qbiei_dV_ci_ei);
d_dynamicContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] += (d_Qbiei_dV_tnode_GND);
dynamicContributions[admsNodeID_ei] -= (Qbiei);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf_GND] -= (d_Qbiei_dV_xf_GND);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci] -= (d_Qbiei_dV_b_ci);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -= (d_Qbiei_dV_bi_ci);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei] -= (d_Qbiei_dV_bi_ei);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -= (d_Qbiei_dV_ci_ei);
d_dynamicContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] -= (d_Qbiei_dV_tnode_GND);
// I(ci,ei) <+ (it)
staticContributions[admsNodeID_ci] += it;
d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] += d_it_dV_ci_ei;
d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci] += d_it_dV_b_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] += d_it_dV_bi_ci;
d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] += d_it_dV_bi_ei;
d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] += d_it_dV_tnode_GND;
d_staticContributions[admsNodeID_ci][admsProbeID_V_xf2_GND] += d_it_dV_xf2_GND;
staticContributions[admsNodeID_ei] -= it;
d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -= d_it_dV_ci_ei;
d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci] -= d_it_dV_b_ci;
d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -= d_it_dV_bi_ci;
d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei] -= d_it_dV_bi_ei;
d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] -= d_it_dV_tnode_GND;
d_staticContributions[admsNodeID_ei][admsProbeID_V_xf2_GND] -= d_it_dV_xf2_GND;
if ((((model_.flsh)==0)||((model_.rth)<0.001)))
{
// I(tnode,GND) <+ ((Vrth/0.001))
staticContributions[admsNodeID_tnode] += (Vrth/0.001);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND] += (d_Vrth_dV_tnode_GND/0.001);
}
else
{
// I(tnode,GND) <+ (((Vrth/rth)-pterm))
staticContributions[admsNodeID_tnode] += ((Vrth/(model_.rth))-pterm);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei] += (-d_pterm_dV_ci_ei);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci] += (-d_pterm_dV_b_ci);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci] += (-d_pterm_dV_bi_ci);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] += (-d_pterm_dV_bi_ei);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci] += (-d_pterm_dV_s_ci);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] += (-d_pterm_dV_b_bi);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e] += (-d_pterm_dV_ei_e);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c] += (-d_pterm_dV_ci_c);
d_staticContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND] += ((d_Vrth_dV_tnode_GND/(model_.rth))-d_pterm_dV_tnode_GND);
// I(tnode,GND) <+ (ddt((cth*Vrth)))
dynamicContributions[admsNodeID_tnode] += (((model_.cth)*Vrth));
d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND] += ((model_.cth)*d_Vrth_dV_tnode_GND);
}
// I(xf1,GND) <+ (Ixf1)
staticContributions[admsNodeID_xf1] += Ixf1;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei] += d_Ixf1_dV_ci_ei;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci] += d_Ixf1_dV_b_ci;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci] += d_Ixf1_dV_bi_ci;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] += d_Ixf1_dV_bi_ei;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_tnode_GND] += d_Ixf1_dV_tnode_GND;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf2_GND] += d_Ixf1_dV_xf2_GND;
d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND] += d_Ixf1_dV_xf1_GND;
// I(xf1,GND) <+ (ddt(Qxf1))
dynamicContributions[admsNodeID_xf1] += (Qxf1);
d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND] += (d_Qxf1_dV_xf1_GND);
// I(xf2,GND) <+ (Ixf2)
staticContributions[admsNodeID_xf2] += Ixf2;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei] += d_Ixf2_dV_bi_ei;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei] += d_Ixf2_dV_ci_ei;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci] += d_Ixf2_dV_b_ci;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] += d_Ixf2_dV_bi_ci;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_tnode_GND] += d_Ixf2_dV_tnode_GND;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf1_GND] += d_Ixf2_dV_xf1_GND;
d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND] += d_Ixf2_dV_xf2_GND;
// I(xf2,GND) <+ (ddt(Qxf2))
dynamicContributions[admsNodeID_xf2] += (Qxf2);
d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND] += (d_Qxf2_dV_xf2_GND);
// I(xf,GND) <+ (Ixf)
staticContributions[admsNodeID_xf] += Ixf;
d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei] += d_Ixf_dV_ci_ei;
d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei] += d_Ixf_dV_bi_ei;
d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci] += d_Ixf_dV_b_ci;
d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] += d_Ixf_dV_bi_ci;
d_staticContributions[admsNodeID_xf][admsProbeID_V_tnode_GND] += d_Ixf_dV_tnode_GND;
d_staticContributions[admsNodeID_xf][admsProbeID_V_xf_GND] += d_Ixf_dV_xf_GND;
// I(xf,GND) <+ (ddt(Qxf))
dynamicContributions[admsNodeID_xf] += (Qxf);
d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf_GND] += (d_Qxf_dV_xf_GND);
fourkt = ((4.0*1.3806503e-23)*Tdev);
if ((((model_.rbx)>=0.001)||((model_.rbi0)>=0.001)))
{
// I(b,bi) <+ (white_noise((fourkt/rb)))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[0]= (fourkt/rb);
}
}
if (((model_.rcx)>=0.001))
{
// I(ci,c) <+ (white_noise((fourkt/rcx_t)))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[1]= (fourkt/rcx_t);
}
}
if (((model_.re)>=0.001))
{
// I(ei,e) <+ (white_noise((fourkt/re_t)))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[2]= (fourkt/re_t);
}
}
twoq = (2.0*1.6021766208e-19);
// I(bi,ei) <+ (white_noise((twoq*ijbe)))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[3]= (twoq*ijbe);
}
// I(ci,ei) <+ (white_noise((twoq*it)))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[4]= (twoq*it);
}
{
double value_pow_0 = pow(ijbe,(model_.af));
double  deriv_pow_0_d0 = ((ijbe == 0.0)?0.0:(value_pow_0*(model_.af)/ijbe));
flicker_Pwr = ((model_.kf)*value_pow_0);
}
// I(bi,ei) <+ (flicker_noise(flicker_Pwr,1.0))
if (getSolverState().noiseFlag)
{
  noiseContribsPower[5]= flicker_Pwr;
  noiseContribsExponent[5]= 1.0;
}
//Begin block OP_calculation
{
//Block-local variables for block OP_calculation
double oRPIi=0.0;
double oRMUi=0.0;
double oROi=0.0;
double gAVL=0.0;
//End of Block-local variables
//Block-local variables for block OP_calculation
double Cdei=0.0;
double Cdci=0.0;
double Cjei=0.0;
double Cjci=0.0;
double Cjcx=0.0;
double CBC=0.0;
//End of Block-local variables
//Block-local variables for block OP_calculation
double R_tot=0.0;
//End of Block-local variables
IAVL = iavl;
VBE = (probeVars[admsProbeID_V_b_e]);
VBC = (probeVars[admsProbeID_V_b_c]);
VCE = (probeVars[admsProbeID_V_c_e]);
VSC = (probeVars[admsProbeID_V_s_c]);
GMi = (+d_it_wop_dV_bi_ci+d_it_wop_dV_bi_ei);
oRPIi = (+d_ijbe_dV_bi_ei);
RPIi = (1.0/(oRPIi+1e-12));
oRMUi = ((-1)*(+d_Ibici_dV_ci_ei-d_Ibici_dV_b_ci-d_Ibici_dV_bi_ci));
RMUi = (1.0/(oRMUi+1e-12));
gAVL = (HICUMtype*(+d_iavl_dV_ci_ei-d_iavl_dV_b_ci-d_iavl_dV_bi_ci));
oROi = (+d_it_wop_dV_ci_ei-d_it_wop_dV_b_ci-d_it_wop_dV_bi_ci);
ROi = (1.0/((oROi+gAVL)+1e-12));
Cdei = (((-1)*HICUMtype)*(-d_qf_dV_ci_ei-d_qf_dV_bi_ei));
Cjei = (+d_qjei_dV_bi_ci+d_qjei_dV_bi_ei);
CPIi = ((Cjei+Cdei)+(model_.cbepar));
Cdci = (((-1)*HICUMtype)*(+d_qr_dV_ci_ei-d_qr_dV_b_ci-d_qr_dV_bi_ci));
Cjci = (+d_qjci_int_dV_bi_ci);
CMUi = (Cjci+Cdci);
Cjcx = ((-1)*(-d_qjcxi_dV_b_ci-d_qjcxi_dV_bi_ci));
CBCX = (Cjcx+(model_.cbcpar));
CCS = (+d_qjs_dV_s_ci);
RBi = rbi;
RB = rb;
RCX = rcx_t;
RE = re_t;
BETAAC = (GMi*RPIi);
R_tot = ((RCX+RE)+((RB+RE)/BETAAC));
TF = tf;
CBC = (CMUi+CBCX);
FT = (GMi/((2*3.14159265358979323846)*((CPIi+CBC)+((R_tot*CBC)*GMi))));
}
// End block OP_calculation


  // -- endcode converted from analog/code block
  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
  {
    Xyce::dout() << " probeVars[admsProbeID_V_s_GND] =  "
         <<probeVars[admsProbeID_V_s_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ei_GND] =  "
         <<probeVars[admsProbeID_V_ei_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ci_GND] =  "
         <<probeVars[admsProbeID_V_ci_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bi_GND] =  "
         <<probeVars[admsProbeID_V_bi_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_s_c] =  "
         <<probeVars[admsProbeID_V_s_c] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_c_e] =  "
         <<probeVars[admsProbeID_V_c_e] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_c] =  "
         <<probeVars[admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_xf_GND] =  "
         <<probeVars[admsProbeID_V_xf_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_xf2_GND] =  "
         <<probeVars[admsProbeID_V_xf2_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_xf1_GND] =  "
         <<probeVars[admsProbeID_V_xf1_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_tnode_GND] =  "
         <<probeVars[admsProbeID_V_tnode_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_e] =  "
         <<probeVars[admsProbeID_V_b_e] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_bi] =  "
         <<probeVars[admsProbeID_V_b_bi] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ci_c] =  "
         <<probeVars[admsProbeID_V_ci_c] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ei_e] =  "
         <<probeVars[admsProbeID_V_ei_e] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_s_ci] =  "
         <<probeVars[admsProbeID_V_s_ci] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ci_ei] =  "
         <<probeVars[admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bi_ei] =  "
         <<probeVars[admsProbeID_V_bi_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bi_ci] =  "
         <<probeVars[admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_ci] =  "
         <<probeVars[admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_c] =  "
         <<staticContributions[admsNodeID_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_c] =  "
         <<dynamicContributions[admsNodeID_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_b] =  "
         <<staticContributions[admsNodeID_b] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_b] =  "
         <<dynamicContributions[admsNodeID_b] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_e] =  "
         <<staticContributions[admsNodeID_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_e] =  "
         <<dynamicContributions[admsNodeID_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_s] =  "
         <<staticContributions[admsNodeID_s] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_s].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_s] =  "
         <<dynamicContributions[admsNodeID_s] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_s].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_tnode] =  "
         <<staticContributions[admsNodeID_tnode] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_tnode].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_tnode] =  "
         <<dynamicContributions[admsNodeID_tnode] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_tnode].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ci] =  "
         <<staticContributions[admsNodeID_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ci] =  "
         <<dynamicContributions[admsNodeID_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_bi] =  "
         <<staticContributions[admsNodeID_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_bi] =  "
         <<dynamicContributions[admsNodeID_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ei] =  "
         <<staticContributions[admsNodeID_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ei] =  "
         <<dynamicContributions[admsNodeID_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_xf1] =  "
         <<staticContributions[admsNodeID_xf1] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf1].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_xf1] =  "
         <<dynamicContributions[admsNodeID_xf1] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf1].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_xf2] =  "
         <<staticContributions[admsNodeID_xf2] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf2].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_xf2] =  "
         <<dynamicContributions[admsNodeID_xf2] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf2].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_xf] =  "
         <<staticContributions[admsNodeID_xf] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_s_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_ei_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_ci_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_bi_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_s_c) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_c_e) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_xf_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_xf2_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_xf1_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_tnode_GND) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_b_e) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_b_bi) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_ci_c) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_ei_e) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_s_ci) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_bi_ei) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    staticContributions[admsNodeID_xf].dx(admsProbeID_V_b_ci) =  " <<d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_xf] =  "
         <<dynamicContributions[admsNodeID_xf] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_s_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_s_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_ei_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_ei_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_ci_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_ci_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_bi_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_bi_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_s_c) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_s_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_c_e) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_c_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_b_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_xf_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_xf2_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf2_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_xf1_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf1_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_tnode_GND) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_tnode_GND] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_b_e) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_b_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_b_bi) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_b_bi] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_ci_c) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_ci_c] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_ei_e) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_ei_e] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_s_ci) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_s_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_ci_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_bi_ei) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_bi_ei] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_bi_ci] << std::endl;
      Xyce::dout() << "    dynamicContributions[admsNodeID_xf].dx(admsProbeID_V_b_ci) =  " <<d_dynamicContributions[admsNodeID_xf][admsProbeID_V_b_ci] << std::endl;

    if (!origFlag)
      Xyce::dout() << "This step was limited by this device." << std::endl;
  }


  if (loadLeadCurrent)
  {
    // If needed, we must now copy all the data from staticContributions
    // and dynamicContributionsinto the lead current F vector
    // Must make sure all collapsed node contributions get summed into the
    // external nodes properly.
    for ( int unmappedNode=0; unmappedNode < 5 ; unmappedNode++)
    {
      leadCurrentF[unmappedNode] = 0.0;
      leadCurrentQ[unmappedNode] = 0.0;
    }
    for ( int unmappedNode=0; unmappedNode < 11; unmappedNode++)
    {
      if (nodeMap[unmappedNode] < 5 && nodeMap[unmappedNode] != -1 )
      {
        leadCurrentF[nodeMap[unmappedNode]] += staticContributions[unmappedNode];
        leadCurrentQ[nodeMap[unmappedNode]] += dynamicContributions[unmappedNode];
      }
    }
  }
  return true;
}

//-----------------------------------------------------------------------------
// Function      : Instance::getNumNoiseSources
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
int Instance::getNumNoiseSources () const
{
return 6;
}

//-----------------------------------------------------------------------------
// Function      : Instance::setupNoiseSources
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::setupNoiseSources (Xyce::Analysis::NoiseData & noiseData)
{
int numSources=getNumNoiseSources();
noiseData.numSources = numSources;
noiseData.resize(numSources);

noiseData.deviceName = getName().getEncodedName();
std::string theNoiseName;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_white_b_bi");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[0]=theNoiseName;
noiseData.li_Pos[0]=li_b;
noiseData.li_Neg[0]=li_bi;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_white_ci_c");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[1]=theNoiseName;
noiseData.li_Pos[1]=li_ci;
noiseData.li_Neg[1]=li_c;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_white_ei_e");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[2]=theNoiseName;
noiseData.li_Pos[2]=li_ei;
noiseData.li_Neg[2]=li_e;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_white_bi_ei");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[3]=theNoiseName;
noiseData.li_Pos[3]=li_bi;
noiseData.li_Neg[3]=li_ei;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_white_ci_ei");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[4]=theNoiseName;
noiseData.li_Pos[4]=li_ci;
noiseData.li_Neg[4]=li_ei;
theNoiseName = std::string("noise_")+getName().getEncodedName()+std::string("_flicker_bi_ei");
std::replace(theNoiseName.begin(), theNoiseName.end(), ' ', '_');
noiseData.noiseNames[5]=theNoiseName;
noiseData.li_Pos[5]=li_bi;
noiseData.li_Neg[5]=li_ei;


}
//-----------------------------------------------------------------------------
// Function      : Instance::getNoiseSources
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::getNoiseSources (Xyce::Analysis::NoiseData & noiseData)
{noiseData.noiseDens[0] = noiseContribsPower[0];
noiseData.lnNoiseDens[0] = std::log(std::max(noiseData.noiseDens[0],N_MINLOG));
noiseData.noiseDens[1] = noiseContribsPower[1];
noiseData.lnNoiseDens[1] = std::log(std::max(noiseData.noiseDens[1],N_MINLOG));
noiseData.noiseDens[2] = noiseContribsPower[2];
noiseData.lnNoiseDens[2] = std::log(std::max(noiseData.noiseDens[2],N_MINLOG));
noiseData.noiseDens[3] = noiseContribsPower[3];
noiseData.lnNoiseDens[3] = std::log(std::max(noiseData.noiseDens[3],N_MINLOG));
noiseData.noiseDens[4] = noiseContribsPower[4];
noiseData.lnNoiseDens[4] = std::log(std::max(noiseData.noiseDens[4],N_MINLOG));
noiseData.noiseDens[5] = noiseContribsPower[5];

      noiseData.noiseDens[5] /= pow(noiseData.freq,noiseContribsExponent[5]);noiseData.lnNoiseDens[5] = std::log(std::max(noiseData.noiseDens[5],N_MINLOG));

}

//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEdFdx
// Purpose       :
// Special Notes : Load the dFdx ("static jacobian") matrix
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEdFdx()
{
  bool bsuccess = true;
  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);

#ifndef Xyce_NONPOINTER_MATRIX_LOAD
  (*f_bi_Equ_bi_Node_Ptr) +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  (*f_bi_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  (*f_ei_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  (*f_ei_Equ_ei_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e] -d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  (*f_bi_Equ_ci_Node_Ptr) +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  (*f_ci_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*f_ci_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c] -d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci] +d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*f_ci_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei];
  (*f_ei_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  (*f_b_Equ_s_Node_Ptr) +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci];
  (*f_b_Equ_ci_Node_Ptr) +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci];
  (*f_s_Equ_s_Node_Ptr) +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci];
  (*f_s_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci];
  (*f_b_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci];
  (*f_s_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci];
  (*f_b_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_tnode_GND];
  (*f_s_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_tnode_GND];
  (*f_s_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  (*f_s_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  (*f_ci_Equ_s_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci];
  (*f_ci_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND];
  (*f_ci_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  (*f_b_Equ_bi_Node_Ptr) +=  -d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci];
  (*f_e_Equ_e_Node_Ptr) +=  -d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e];
  (*f_ei_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND];
  (*f_e_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_e][admsProbeID_V_tnode_GND];
  (*f_ei_Equ_e_Node_Ptr) +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e];
  (*f_e_Equ_ei_Node_Ptr) +=  +d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e];
  (*f_c_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_c][admsProbeID_V_tnode_GND];
  (*f_ci_Equ_c_Node_Ptr) +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c];
  (*f_c_Equ_ci_Node_Ptr) +=  +d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c];
  (*f_c_Equ_c_Node_Ptr) +=  -d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c];
  (*f_bi_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci];
  (*f_b_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei];
  (*f_bi_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND];
  (*f_ei_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  (*f_ci_Equ_xf2_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_xf2_GND];
  (*f_ei_Equ_xf2_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_xf2_GND];
  (*f_tnode_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND];
  (*f_tnode_Equ_ci_Node_Ptr) +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei];
  (*f_tnode_Equ_ei_Node_Ptr) +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei];
  (*f_tnode_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci];
  (*f_tnode_Equ_bi_Node_Ptr) +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci];
  (*f_tnode_Equ_s_Node_Ptr) +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci];
  (*f_tnode_Equ_e_Node_Ptr) +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e];
  (*f_tnode_Equ_c_Node_Ptr) +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c];
  (*f_xf1_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei];
  (*f_xf1_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei];
  (*f_xf1_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci];
  (*f_xf1_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci];
  (*f_xf1_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_tnode_GND];
  (*f_xf1_Equ_xf2_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf2_GND];
  (*f_xf1_Equ_xf1_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND];
  (*f_xf2_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei];
  (*f_xf2_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei];
  (*f_xf2_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei];
  (*f_xf2_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci];
  (*f_xf2_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_tnode_GND];
  (*f_xf2_Equ_xf1_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf1_GND];
  (*f_xf2_Equ_xf2_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND];
  (*f_xf_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei];
  (*f_xf_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei];
  (*f_xf_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei];
  (*f_xf_Equ_b_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci];
  (*f_xf_Equ_tnode_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_tnode_GND];
  (*f_xf_Equ_xf_Node_Ptr) +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_xf_GND];

#else
  //use the offsets instead of pointers
  dFdx[li_bi][A_bi_Equ_bi_NodeOffset] +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  dFdx[li_bi][A_bi_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  dFdx[li_ei][A_ei_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  dFdx[li_ei][A_ei_Equ_ei_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e] -d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  dFdx[li_bi][A_bi_Equ_ci_NodeOffset] +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  dFdx[li_ci][A_ci_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dFdx[li_ci][A_ci_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c] -d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci] +d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dFdx[li_ci][A_ci_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei];
  dFdx[li_ei][A_ei_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  dFdx[li_b][A_b_Equ_s_NodeOffset] +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci];
  dFdx[li_b][A_b_Equ_ci_NodeOffset] +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_b][admsProbeID_V_s_ci];
  dFdx[li_s][A_s_Equ_s_NodeOffset] +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci];
  dFdx[li_s][A_s_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci] -d_staticContributions[admsNodeID_s][admsProbeID_V_s_ci];
  dFdx[li_b][A_b_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_b][admsProbeID_V_b_ci];
  dFdx[li_s][A_s_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_b_ci];
  dFdx[li_b][A_b_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_b][admsProbeID_V_tnode_GND];
  dFdx[li_s][A_s_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_tnode_GND];
  dFdx[li_s][A_s_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  dFdx[li_s][A_s_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  dFdx[li_ci][A_ci_Equ_s_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_s_ci];
  dFdx[li_ci][A_ci_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_tnode_GND];
  dFdx[li_ci][A_ci_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  dFdx[li_b][A_b_Equ_bi_NodeOffset] +=  -d_staticContributions[admsNodeID_b][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci];
  dFdx[li_e][A_e_Equ_e_NodeOffset] +=  -d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e];
  dFdx[li_ei][A_ei_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_tnode_GND];
  dFdx[li_e][A_e_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_e][admsProbeID_V_tnode_GND];
  dFdx[li_ei][A_ei_Equ_e_NodeOffset] +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_ei_e];
  dFdx[li_e][A_e_Equ_ei_NodeOffset] +=  +d_staticContributions[admsNodeID_e][admsProbeID_V_ei_e];
  dFdx[li_c][A_c_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_c][admsProbeID_V_tnode_GND];
  dFdx[li_ci][A_ci_Equ_c_NodeOffset] +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_c];
  dFdx[li_c][A_c_Equ_ci_NodeOffset] +=  +d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c];
  dFdx[li_c][A_c_Equ_c_NodeOffset] +=  -d_staticContributions[admsNodeID_c][admsProbeID_V_ci_c];
  dFdx[li_bi][A_bi_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_b_ci];
  dFdx[li_b][A_b_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei];
  dFdx[li_bi][A_bi_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_tnode_GND];
  dFdx[li_ei][A_ei_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  dFdx[li_ci][A_ci_Equ_xf2_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_xf2_GND];
  dFdx[li_ei][A_ei_Equ_xf2_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_xf2_GND];
  dFdx[li_tnode][A_tnode_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND];
  dFdx[li_tnode][A_tnode_Equ_ci_NodeOffset] +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei];
  dFdx[li_tnode][A_tnode_Equ_ei_NodeOffset] +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_ei];
  dFdx[li_tnode][A_tnode_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_ci];
  dFdx[li_tnode][A_tnode_Equ_bi_NodeOffset] +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_b_bi] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_tnode][admsProbeID_V_bi_ci];
  dFdx[li_tnode][A_tnode_Equ_s_NodeOffset] +=  +d_staticContributions[admsNodeID_tnode][admsProbeID_V_s_ci];
  dFdx[li_tnode][A_tnode_Equ_e_NodeOffset] +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ei_e];
  dFdx[li_tnode][A_tnode_Equ_c_NodeOffset] +=  -d_staticContributions[admsNodeID_tnode][admsProbeID_V_ci_c];
  dFdx[li_xf1][A_xf1_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei];
  dFdx[li_xf1][A_xf1_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_xf1][admsProbeID_V_ci_ei];
  dFdx[li_xf1][A_xf1_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_b_ci];
  dFdx[li_xf1][A_xf1_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ei] +d_staticContributions[admsNodeID_xf1][admsProbeID_V_bi_ci];
  dFdx[li_xf1][A_xf1_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_tnode_GND];
  dFdx[li_xf1][A_xf1_Equ_xf2_NodeOffset] +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf2_GND];
  dFdx[li_xf1][A_xf1_Equ_xf1_NodeOffset] +=  +d_staticContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND];
  dFdx[li_xf2][A_xf2_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei];
  dFdx[li_xf2][A_xf2_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ei];
  dFdx[li_xf2][A_xf2_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_xf2][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf2][admsProbeID_V_ci_ei];
  dFdx[li_xf2][A_xf2_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_b_ci];
  dFdx[li_xf2][A_xf2_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_tnode_GND];
  dFdx[li_xf2][A_xf2_Equ_xf1_NodeOffset] +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf1_GND];
  dFdx[li_xf2][A_xf2_Equ_xf2_NodeOffset] +=  +d_staticContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND];
  dFdx[li_xf][A_xf_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] -d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci] +d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei];
  dFdx[li_xf][A_xf_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei] -d_staticContributions[admsNodeID_xf][admsProbeID_V_ci_ei];
  dFdx[li_xf][A_xf_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ci] +d_staticContributions[admsNodeID_xf][admsProbeID_V_bi_ei];
  dFdx[li_xf][A_xf_Equ_b_NodeOffset] +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_b_ci];
  dFdx[li_xf][A_xf_Equ_tnode_NodeOffset] +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_tnode_GND];
  dFdx[li_xf][A_xf_Equ_xf_NodeOffset] +=  +d_staticContributions[admsNodeID_xf][admsProbeID_V_xf_GND];

#endif

  return bsuccess;
}


//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEdQdx
// Purpose       :
// Special Notes : Load the dQdx ("dynamic jacobian") matrix
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEdQdx()
{
  bool bsuccess = true;
  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);

#ifndef Xyce_NONPOINTER_MATRIX_LOAD
  (*q_bi_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  (*q_bi_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei] -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei];
  (*q_ei_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci];
  (*q_ei_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  (*q_bi_Equ_ci_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci] +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei];
  (*q_ci_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*q_ci_Equ_ci_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  (*q_ci_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei];
  (*q_ei_Equ_ci_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  (*q_b_Equ_ci_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci];
  (*q_s_Equ_s_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci];
  (*q_s_Equ_ci_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci];
  (*q_b_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e] +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci];
  (*q_s_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci];
  (*q_b_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_tnode_GND];
  (*q_s_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_tnode_GND];
  (*q_s_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci];
  (*q_s_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  (*q_ci_Equ_s_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci];
  (*q_ci_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND];
  (*q_ci_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  (*q_b_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci];
  (*q_b_Equ_e_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e];
  (*q_e_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e];
  (*q_e_Equ_e_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e];
  (*q_ei_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_tnode_GND];
  (*q_bi_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci];
  (*q_bi_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_tnode_GND];
  (*q_bi_Equ_xf_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf_GND];
  (*q_ei_Equ_xf_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf_GND];
  (*q_ei_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  (*q_tnode_Equ_tnode_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND];
  (*q_xf1_Equ_xf1_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND];
  (*q_xf2_Equ_xf2_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND];
  (*q_xf_Equ_xf_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf_GND];

#else
  //use the offsets instead of pointers
  dQdx[li_bi][A_bi_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei];
  dQdx[li_bi][A_bi_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ei] -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei];
  dQdx[li_ei][A_ei_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci];
  dQdx[li_ei][A_ei_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ei];
  dQdx[li_bi][A_bi_Equ_ci_NodeOffset] +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci] +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei];
  dQdx[li_ci][A_ci_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dQdx[li_ci][A_ci_Equ_ci_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  dQdx[li_ci][A_ci_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ei];
  dQdx[li_ei][A_ei_Equ_ci_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  dQdx[li_b][A_b_Equ_ci_NodeOffset] +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci];
  dQdx[li_s][A_s_Equ_s_NodeOffset] +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci];
  dQdx[li_s][A_s_Equ_ci_NodeOffset] +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_s_ci] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci];
  dQdx[li_b][A_b_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e] +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_ci];
  dQdx[li_s][A_s_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_b_ci];
  dQdx[li_b][A_b_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_tnode_GND];
  dQdx[li_s][A_s_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_tnode_GND];
  dQdx[li_s][A_s_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei] +d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ci];
  dQdx[li_s][A_s_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_s][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_s][admsProbeID_V_bi_ei];
  dQdx[li_ci][A_ci_Equ_s_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_s_ci];
  dQdx[li_ci][A_ci_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_tnode_GND];
  dQdx[li_ci][A_ci_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_ci];
  dQdx[li_b][A_b_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci];
  dQdx[li_b][A_b_Equ_e_NodeOffset] +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_e];
  dQdx[li_e][A_e_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e];
  dQdx[li_e][A_e_Equ_e_NodeOffset] +=  -d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_e];
  dQdx[li_ei][A_ei_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_tnode_GND];
  dQdx[li_bi][A_bi_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_ci];
  dQdx[li_bi][A_bi_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_tnode_GND];
  dQdx[li_bi][A_bi_Equ_xf_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_xf_GND];
  dQdx[li_ei][A_ei_Equ_xf_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_xf_GND];
  dQdx[li_ei][A_ei_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_ci];
  dQdx[li_tnode][A_tnode_Equ_tnode_NodeOffset] +=  +d_dynamicContributions[admsNodeID_tnode][admsProbeID_V_tnode_GND];
  dQdx[li_xf1][A_xf1_Equ_xf1_NodeOffset] +=  +d_dynamicContributions[admsNodeID_xf1][admsProbeID_V_xf1_GND];
  dQdx[li_xf2][A_xf2_Equ_xf2_NodeOffset] +=  +d_dynamicContributions[admsNodeID_xf2][admsProbeID_V_xf2_GND];
  dQdx[li_xf][A_xf_Equ_xf_NodeOffset] +=  +d_dynamicContributions[admsNodeID_xf][admsProbeID_V_xf_GND];


#endif
  return bsuccess;
}




//-----------------------------------------------------------------------------
// Function      : Instance::updateTemperature
// Purpose       : Set temperature and update any parameters that depend on it
// Special Notes : In Xyce ADMS, we'll simply copy the temperature, which is
//                 in Kelvin, to our "admsTemperature" variable, which needs
//                 to be in Celsius.
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateTemperature(const double & temperatureTemp)
{

  admsTemperature = temperatureTemp;
  adms_vt_nom = adms_vt(temperatureTemp);

  return true;
}

// Class Model
//-----------------------------------------------------------------------------
// Function      : Model::processParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Model::processParams()
{

  // Set any non-constant parameter defaults:
  // Set any parameters that were not given and whose defaults depend on other
  // parameters:

// set internal model type based on model card type
if (getType() == "pnp" || getType() == "PNP")
    type = -1;



  // Now we need to check that any parameters are within their ranges as
  // specified in the verilog:

//    Parameter is : [ 0, 1 ]
  if ( (!((is >=0 && is <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter is value " << is << " out of range [ 0, 1 ]";
  }

//    Parameter mcf : ] 0, 10 ]
  if ( (!((mcf >0 && mcf <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter mcf value " << mcf << " out of range ] 0, 10 ]";
  }

//    Parameter mcr : ] 0, 10 ]
  if ( (!((mcr >0 && mcr <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter mcr value " << mcr << " out of range ] 0, 10 ]";
  }

//    Parameter vef : ] 0, 1.0e6 ]
  if ( (!((vef >0 && vef <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vef value " << vef << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter ver : ] 0, 1.0e6 ]
  if ( (!((ver >0 && ver <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ver value " << ver << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter aver : [ 0, 100 ]
  if ( (!((aver >=0 && aver <=100 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter aver value " << aver << " out of range [ 0, 100 ]";
  }

//    Parameter iqf : ] 0, 1.0e6 ]
  if ( (!((iqf >0 && iqf <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter iqf value " << iqf << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter fiqf : [ 0, 1 ]
  if ( (!((fiqf >=0 && fiqf <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter fiqf value " << fiqf << " out of range [ 0, 1 ]";
  }

//    Parameter iqr : ] 0, 1.0e6 ]
  if ( (!((iqr >0 && iqr <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter iqr value " << iqr << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter iqfh : ] 0, 1.0e6 ]
  if ( (!((iqfh >0 && iqfh <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter iqfh value " << iqfh << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter tfh : [ 0, 1.0e6 [
  if ( (!((tfh >=0 && tfh <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter tfh value " << tfh << " out of range [ 0, 1.0e6 [";
  }

//    Parameter ahq : [ (-0.9), 1.0e6 ]
  if ( (!((ahq >=(-0.9) && ahq <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ahq value " << ahq << " out of range [ (-0.9), 1.0e6 ]";
  }

//    Parameter ibes : [ 0, 1 ]
  if ( (!((ibes >=0 && ibes <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ibes value " << ibes << " out of range [ 0, 1 ]";
  }

//    Parameter mbe : ] 0, 10 ]
  if ( (!((mbe >0 && mbe <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter mbe value " << mbe << " out of range ] 0, 10 ]";
  }

//    Parameter ires : [ 0, 1 ]
  if ( (!((ires >=0 && ires <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ires value " << ires << " out of range [ 0, 1 ]";
  }

//    Parameter mre : ] 0, 10 ]
  if ( (!((mre >0 && mre <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter mre value " << mre << " out of range ] 0, 10 ]";
  }

//    Parameter ibcs : [ 0, 1 ]
  if ( (!((ibcs >=0 && ibcs <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ibcs value " << ibcs << " out of range [ 0, 1 ]";
  }

//    Parameter mbc : ] 0, 10 ]
  if ( (!((mbc >0 && mbc <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter mbc value " << mbc << " out of range ] 0, 10 ]";
  }

//    Parameter cje0 : ] 0, 1.0e6 [
  if ( (!((cje0 >0 && cje0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cje0 value " << cje0 << " out of range ] 0, 1.0e6 [";
  }

//    Parameter vde : ] 0, 10 ]
  if ( (!((vde >0 && vde <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vde value " << vde << " out of range ] 0, 10 ]";
  }

//    Parameter ze : ] 0, 1 [
  if ( (!((ze >0 && ze <1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ze value " << ze << " out of range ] 0, 1 [";
  }

//    Parameter aje : [ 1, 1.0e6 [
  if ( (!((aje >=1 && aje <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter aje value " << aje << " out of range [ 1, 1.0e6 [";
  }

//    Parameter vdedc : ] 0, 10 ]
  if ( (!((vdedc >0 && vdedc <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vdedc value " << vdedc << " out of range ] 0, 10 ]";
  }

//    Parameter zedc : ] 0, 2 [
  if ( (!((zedc >0 && zedc <2 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter zedc value " << zedc << " out of range ] 0, 2 [";
  }

//    Parameter ajedc : [ 1, 1.0e6 [
  if ( (!((ajedc >=1 && ajedc <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ajedc value " << ajedc << " out of range [ 1, 1.0e6 [";
  }

//    Parameter t0 : [ 0, 1.0e6 [
  if ( (!((t0 >=0 && t0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter t0 value " << t0 << " out of range [ 0, 1.0e6 [";
  }

//    Parameter tbvl : [ 0, 1.0e6 [
  if ( (!((tbvl >=0 && tbvl <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter tbvl value " << tbvl << " out of range [ 0, 1.0e6 [";
  }

//    Parameter tef0 : [ 0, 1.0e6 [
  if ( (!((tef0 >=0 && tef0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter tef0 value " << tef0 << " out of range [ 0, 1.0e6 [";
  }

//    Parameter gte : ] 0, 20 ]
  if ( (!((gte >0 && gte <=20 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter gte value " << gte << " out of range ] 0, 20 ]";
  }

//    Parameter thcs : [ 0, 1.0e6 [
  if ( (!((thcs >=0 && thcs <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter thcs value " << thcs << " out of range [ 0, 1.0e6 [";
  }

//    Parameter ahc : ] 0, 10 ]
  if ( (!((ahc >0 && ahc <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter ahc value " << ahc << " out of range ] 0, 10 ]";
  }

//    Parameter tr : [ 0, 1.0e6 [
  if ( (!((tr >=0 && tr <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter tr value " << tr << " out of range [ 0, 1.0e6 [";
  }

//    Parameter rci0 : ] 0, 1.0e6 [
  if ( (!((rci0 >0 && rci0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter rci0 value " << rci0 << " out of range ] 0, 1.0e6 [";
  }

//    Parameter vlim : ] 0, 10 ]
  if ( (!((vlim >0 && vlim <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vlim value " << vlim << " out of range ] 0, 10 ]";
  }

//    Parameter vpt : ] 0, 100 ]
  if ( (!((vpt >0 && vpt <=100 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vpt value " << vpt << " out of range ] 0, 100 ]";
  }

//    Parameter vces : [ 0, 1 ]
  if ( (!((vces >=0 && vces <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vces value " << vces << " out of range [ 0, 1 ]";
  }

//    Parameter cjci0 : ] 0, 1.0e6 [
  if ( (!((cjci0 >0 && cjci0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cjci0 value " << cjci0 << " out of range ] 0, 1.0e6 [";
  }

//    Parameter vdci : ] 0, 10 ]
  if ( (!((vdci >0 && vdci <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vdci value " << vdci << " out of range ] 0, 10 ]";
  }

//    Parameter zci : ] 0, 1 ]
  if ( (!((zci >0 && zci <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter zci value " << zci << " out of range ] 0, 1 ]";
  }

//    Parameter vptci : ] 0, 100 ]
  if ( (!((vptci >0 && vptci <=100 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vptci value " << vptci << " out of range ] 0, 100 ]";
  }

//    Parameter cjcx0 : [ 0, 1.0e6 [
  if ( (!((cjcx0 >=0 && cjcx0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cjcx0 value " << cjcx0 << " out of range [ 0, 1.0e6 [";
  }

//    Parameter vdcx : ] 0, 10 ]
  if ( (!((vdcx >0 && vdcx <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vdcx value " << vdcx << " out of range ] 0, 10 ]";
  }

//    Parameter zcx : ] 0, 1 ]
  if ( (!((zcx >0 && zcx <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter zcx value " << zcx << " out of range ] 0, 1 ]";
  }

//    Parameter vptcx : ] 0, 100 ]
  if ( (!((vptcx >0 && vptcx <=100 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vptcx value " << vptcx << " out of range ] 0, 100 ]";
  }

//    Parameter fbc : [ 0, 1 ]
  if ( (!((fbc >=0 && fbc <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter fbc value " << fbc << " out of range [ 0, 1 ]";
  }

//    Parameter rbi0 : [ 0, 1.0e6 [
  if ( (!((rbi0 >=0 && rbi0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter rbi0 value " << rbi0 << " out of range [ 0, 1.0e6 [";
  }

//    Parameter vr0e : ] 0, 1.0e6 ]
  if ( (!((vr0e >0 && vr0e <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vr0e value " << vr0e << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter vr0c : ] 0, 1.0e6 ]
  if ( (!((vr0c >0 && vr0c <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vr0c value " << vr0c << " out of range ] 0, 1.0e6 ]";
  }

//    Parameter fgeo : [ 0, 1.0e6 ]
  if ( (!((fgeo >=0 && fgeo <=1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter fgeo value " << fgeo << " out of range [ 0, 1.0e6 ]";
  }

//    Parameter rbx : [ 0, 1.0e6 [
  if ( (!((rbx >=0 && rbx <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter rbx value " << rbx << " out of range [ 0, 1.0e6 [";
  }

//    Parameter rcx : [ 0, 1.0e6 [
  if ( (!((rcx >=0 && rcx <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter rcx value " << rcx << " out of range [ 0, 1.0e6 [";
  }

//    Parameter re : [ 0, 1.0e6 [
  if ( (!((re >=0 && re <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter re value " << re << " out of range [ 0, 1.0e6 [";
  }

//    Parameter itss : [ 0, 1.0 ]
  if ( (!((itss >=0 && itss <=1.0 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter itss value " << itss << " out of range [ 0, 1.0 ]";
  }

//    Parameter msf : ] 0, 10 ]
  if ( (!((msf >0 && msf <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter msf value " << msf << " out of range ] 0, 10 ]";
  }

//    Parameter iscs : [ 0, 1.0 ]
  if ( (!((iscs >=0 && iscs <=1.0 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter iscs value " << iscs << " out of range [ 0, 1.0 ]";
  }

//    Parameter msc : ] 0, 10 ]
  if ( (!((msc >0 && msc <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter msc value " << msc << " out of range ] 0, 10 ]";
  }

//    Parameter cjs0 : [ 0, 1.0e6 [
  if ( (!((cjs0 >=0 && cjs0 <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cjs0 value " << cjs0 << " out of range [ 0, 1.0e6 [";
  }

//    Parameter vds : ] 0, 10 ]
  if ( (!((vds >0 && vds <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vds value " << vds << " out of range ] 0, 10 ]";
  }

//    Parameter zs : ] 0, 1 ]
  if ( (!((zs >0 && zs <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter zs value " << zs << " out of range ] 0, 1 ]";
  }

//    Parameter vpts : ] 0, 100 ]
  if ( (!((vpts >0 && vpts <=100 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vpts value " << vpts << " out of range ] 0, 100 ]";
  }

//    Parameter cbcpar : [ 0, 1.0e6 [
  if ( (!((cbcpar >=0 && cbcpar <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cbcpar value " << cbcpar << " out of range [ 0, 1.0e6 [";
  }

//    Parameter cbepar : [ 0, 1.0e6 [
  if ( (!((cbepar >=0 && cbepar <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cbepar value " << cbepar << " out of range [ 0, 1.0e6 [";
  }

//    Parameter eavl : [ 0,  (+inf) [
  if ( (!((eavl >=0))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter eavl value " << eavl << " out of range [ 0,  (+inf) [";
  }

//    Parameter kavl : [ 0, 1.0e6 [
  if ( (!((kavl >=0 && kavl <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter kavl value " << kavl << " out of range [ 0, 1.0e6 [";
  }

//    Parameter kf : [ 0, 1.0e6 [
  if ( (!((kf >=0 && kf <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter kf value " << kf << " out of range [ 0, 1.0e6 [";
  }

//    Parameter af : ] 0, 10 ]
  if ( (!((af >0 && af <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter af value " << af << " out of range ] 0, 10 ]";
  }

//    Parameter alqf : ] 0, 1 ]
  if ( (!((alqf >0 && alqf <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter alqf value " << alqf << " out of range ] 0, 1 ]";
  }

//    Parameter alit : ] 0, 1 ]
  if ( (!((alit >0 && alit <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter alit value " << alit << " out of range ] 0, 1 ]";
  }

//    Parameter flnqs : [ 0, 1 ]
  if ( (!((flnqs >=0 && flnqs <=1 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter flnqs value " << flnqs << " out of range [ 0, 1 ]";
  }

//    Parameter vgb : ] 0, 10 ]
  if ( (!((vgb >0 && vgb <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vgb value " << vgb << " out of range ] 0, 10 ]";
  }

//    Parameter vge : ] 0, 10 ]
  if ( (!((vge >0 && vge <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vge value " << vge << " out of range ] 0, 10 ]";
  }

//    Parameter vgc : ] 0, 10 ]
  if ( (!((vgc >0 && vgc <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vgc value " << vgc << " out of range ] 0, 10 ]";
  }

//    Parameter vgs : ] 0, 10 ]
  if ( (!((vgs >0 && vgs <=10 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter vgs value " << vgs << " out of range ] 0, 10 ]";
  }

//    Parameter flsh : [ 0, 2 ]
  if ( (!((flsh >=0 && flsh <=2 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter flsh value " << flsh << " out of range [ 0, 2 ]";
  }

//    Parameter rth : [ 0, 1.0e6 [
  if ( (!((rth >=0 && rth <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter rth value " << rth << " out of range [ 0, 1.0e6 [";
  }

//    Parameter cth : [ 0, 1.0e6 [
  if ( (!((cth >=0 && cth <1.0e6 ))) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter cth value " << cth << " out of range [ 0, 1.0e6 [";
  }

//    Parameter type : [ (-1), 1 ]] 0, 0 [
  if ( (!((type >=(-1) && type <=1 )) || (type >0 && type <0 )) )
  {
    UserWarning(*this) << "ADMShic0_full: Parameter type value " << type << " out of range [ (-1), 1 ] or  ] 0, 0 [";
  }

  // and of course, this routine is where we should put the initial_model
  // stuff


  return true;
}
//----------------------------------------------------------------------------
// Function      : Model::processInstanceParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//----------------------------------------------------------------------------
bool Model::processInstanceParams()
{

  std::vector<Instance*>::iterator iter;
  std::vector<Instance*>::iterator first = instanceContainer.begin();
  std::vector<Instance*>::iterator last  = instanceContainer.end();

  for (iter=first; iter!=last; ++iter)
  {
    (*iter)->processParams();
  }

  return true;
}

//-----------------------------------------------------------------------------
// Function      : Model::Model
// Purpose       : model block constructor
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
Model::Model(
  const Configuration & configuration,
  const ModelBlock &    model_block,
  const FactoryBlock &  factory_block)
  : DeviceModel(model_block, configuration.getModelParameters(), factory_block),
    is(1.0e-16),
    it_mod(0),
    mcf(1.00),
    mcr(1.00),
    vef(1.0e6),
    ver(1.0e6),
    aver(0.0),
    iqf(1.0e6),
    fiqf(0),
    iqr(1.0e6),
    iqfh(1.0e6),
    tfh(0.0),
    ahq(0),
    ibes(1e-18),
    mbe(1.0),
    ires(0.0),
    mre(2.0),
    ibcs(0.0),
    mbc(1.0),
    cje0(1.0e-20),
    vde(0.9),
    ze(0.5),
    aje(2.5),
    vdedc(0.9),
    zedc(0.5),
    ajedc(2.5),
    t0(0.0),
    dt0h(0.0),
    tbvl(0.0),
    tef0(0.0),
    gte(1.0),
    thcs(0.0),
    ahc(0.1),
    tr(0.0),
    rci0(150),
    vlim(0.5),
    vpt(100),
    vces(0.1),
    cjci0(1.0e-20),
    vdci(0.7),
    zci(0.333),
    vptci(100),
    cjcx0(1.0e-20),
    vdcx(0.7),
    zcx(0.333),
    vptcx(100),
    fbc(1.0),
    rbi0(0.0),
    vr0e(2.5),
    vr0c(1.0e6),
    fgeo(0.656),
    rbx(0.0),
    rcx(0.0),
    re(0.0),
    itss(0.0),
    msf(1.0),
    iscs(0.0),
    msc(1.0),
    cjs0(1.0e-20),
    vds(0.3),
    zs(0.3),
    vpts(100),
    cbcpar(0.0),
    cbepar(0.0),
    eavl(0.0),
    kavl(0.0),
    kf(0.0),
    af(2.0),
    alqf(0.167),
    alit(0.333),
    flnqs(0),
    vgb(1.2),
    vge(1.17),
    vgc(1.17),
    vgs(1.17),
    f1vg((-1.02377e-4)),
    f2vg(4.3215e-4),
    alt0(0.0),
    kt0(0.0),
    zetact(3.0),
    zetabet(3.5),
    zetaci(0.0),
    alvs(0.0),
    alces(0.0),
    zetarbi(0.0),
    zetarbx(0.0),
    zetarcx(0.0),
    zetare(0.0),
    zetaiqf(0.0),
    alkav(0.0),
    aleav(0.0),
    zetarth(0.0),
    tef_temp(1),
    zetaver((-1.0)),
    zetavgbe(1.0),
    dvgbe(0.0),
    aliqfh(0),
    kiqfh(0),
    flsh(0),
    rth(0.0),
    cth(0.0),
    type(1),
    tnom(27)
{
  // Set params to constant default values (from parTable):
  setDefaultParams();

  // Set params according to .model line and constant defaults from metadata:
  setModParams(model_block.params);

  if (!given("XYCEADMSMODTEMP"))
    admsModTemp=getDeviceOptions().temp.getImmutableValue<double>();

  // Calculate any parameters specified as expressions:

  updateDependentParameters();

  // calculate dependent (ie computed) params and check for errors:
  processParams();
}

//-----------------------------------------------------------------------------
// Function      : Model::~Model
// Purpose       : destructor
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
Model::~Model()
{
  std::vector<Instance*>::iterator iterI;
  std::vector<Instance*>::iterator firstI = instanceContainer.begin ();
  std::vector<Instance*>::iterator lastI  = instanceContainer.end ();

  // loop over instances:
  for (iterI = firstI; iterI != lastI; ++iterI)
  {
    delete (*iterI);
  }
}

//-----------------------------------------------------------------------------
// Function      : Model::printOutInstances
// Purpose       : debugging tool.
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
std::ostream &Model::printOutInstances(std::ostream &os) const
{
  std::vector<Instance*>::const_iterator iter;
  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
  std::vector<Instance*>::const_iterator last  = instanceContainer.end();

  int i;
  os << std::endl;
  os << "    name     model name  Parameters" << std::endl;
  for (i=0, iter=first; iter!=last; ++iter, ++i)
  {
    os << "  " << i << ": " << (*iter)->getName() << "      ";
    os << getName();

    os << std::endl;
      os << "DT  =  " << (*iter)->dt << std::endl;
    os << std::endl;
  }

  os << std::endl;

  return os;
}

//-----------------------------------------------------------------------------
// Function      : Model::forEachInstance
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : David Baur
// Creation Date : 2/4/2014
//-----------------------------------------------------------------------------
/// Apply a device instance "op" to all instances associated with this
/// model
///
/// @param[in] op Operator to apply to all instances.
///
///
void Model::forEachInstance(DeviceInstanceOp &op) const
{
  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
    op(*it);
}

Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
{
  return new DeviceMaster<Traits>(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
}

void
registerDevice(const DeviceCountMap& deviceMap, const std::set<int>& levelSet)
{
if (deviceMap.empty() ||
((deviceMap.find("Q") != deviceMap.end() && (levelSet.find(230)!=levelSet.end()))))
{
BJT::registerDevice();

  Config<Traits>::addConfiguration()
    .registerDevice("q", 230)
    .registerModelType("npn", 230)
    .registerModelType("pnp", 230);
}
}


#ifdef Xyce_ADMS_SENSITIVITIES
//-----------------------------------------------------------------------------
// Function      : evaluateInitialInstance
// Purpose       : Evaluate the statements in the initial_instance block
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateInitialInstance(
instanceSensStruct & instanceStruct,
modelSensStruct & modelStruct,
 double admsTemperature, double adms_vt_nom, double ADMSgmin_arg, const Instance & theInstance)
{
}



//-----------------------------------------------------------------------------
// Function      : evaluateInitialModel
// Purpose       : Evaluate the statements in the initial_model block
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateInitialModel(
modelSensStruct & modelStruct,
 double admsTemperature, double ADMSgmin_arg, const Instance & theInstance)
{
}



//-----------------------------------------------------------------------------
// Function      : evaluateModelEquations
// Purpose       : Evaluate the main module block.  Similar to
//                 updateIntermediateVars, but takes all instance and model
//                 parameters and variables as arguments instead of using
//                 the ones stored in the objects.
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateModelEquations(
std::vector <double> & probeVars,
// probe constants
const int admsProbeID_V_s_GND,
const int admsProbeID_V_ei_GND,
const int admsProbeID_V_ci_GND,
const int admsProbeID_V_bi_GND,
const int admsProbeID_V_s_c,
const int admsProbeID_V_c_e,
const int admsProbeID_V_b_c,
const int admsProbeID_V_xf_GND,
const int admsProbeID_V_xf2_GND,
const int admsProbeID_V_xf1_GND,
const int admsProbeID_V_tnode_GND,
const int admsProbeID_V_b_e,
const int admsProbeID_V_b_bi,
const int admsProbeID_V_ci_c,
const int admsProbeID_V_ei_e,
const int admsProbeID_V_s_ci,
const int admsProbeID_V_ci_ei,
const int admsProbeID_V_bi_ei,
const int admsProbeID_V_bi_ci,
const int admsProbeID_V_b_ci,
// node constants
const int admsNodeID_c,
const int admsNodeID_b,
const int admsNodeID_e,
const int admsNodeID_s,
const int admsNodeID_tnode,
const int admsNodeID_ci,
const int admsNodeID_bi,
const int admsNodeID_ei,
const int admsNodeID_xf1,
const int admsNodeID_xf2,
const int admsNodeID_xf,
instanceSensStruct & instanceStruct,
modelSensStruct & modelStruct,
// basic variables
 double admsTemperature, double adms_vt_nom, double ADMSgmin_arg, std::vector <double> & d_staticContributions_dX, std::vector <double> & d_dynamicContributions_dX, const Instance & theInstance)
{

  // Local variables
  double flicker_Pwr=0.0;
double d_flicker_Pwr_dX=0.0;
  double twoq=0.0;
  double fourkt=0.0;
double d_fourkt_dX=0.0;
  double it_wop=0.0;
double d_it_wop_dX=0.0;
  double Qbiei=0.0;
double d_Qbiei_dX=0.0;
  double Qbici=0.0;
double d_Qbici_dX=0.0;
  double Qbe=0.0;
double d_Qbe_dX=0.0;
  double Qbci=0.0;
double d_Qbci_dX=0.0;
  double Qxf=0.0;
double d_Qxf_dX=0.0;
  double Ixf=0.0;
double d_Ixf_dX=0.0;
  double fact=0.0;
double d_fact_dX=0.0;
  double Vxf=0.0;
  double Qxf2=0.0;
double d_Qxf2_dX=0.0;
  double Qxf1=0.0;
double d_Qxf1_dX=0.0;
  double Ixf2=0.0;
double d_Ixf2_dX=0.0;
  double Ixf1=0.0;
double d_Ixf1_dX=0.0;
  double Vxf2=0.0;
  double Vxf1=0.0;
  double Qdeix=0.0;
double d_Qdeix_dX=0.0;
  double Itxf=0.0;
double d_Itxf_dX=0.0;
  double pterm=0.0;
double d_pterm_dX=0.0;
  double qjs=0.0;
double d_qjs_dX=0.0;
  double HSI_Tsu=0.0;
double d_HSI_Tsu_dX=0.0;
  double HSb=0.0;
double d_HSb_dX=0.0;
  double HSa=0.0;
double d_HSa_dX=0.0;
  double HSUM=0.0;
double d_HSUM_dX=0.0;
  double rb=0.0;
double d_rb_dX=0.0;
  double eta=0.0;
double d_eta_dX=0.0;
  double rbi=0.0;
double d_rbi_dX=0.0;
  double fQz=0.0;
double d_fQz_dX=0.0;
  double Qz_nom=0.0;
double d_Qz_nom_dX=0.0;
  double a_iavl=0.0;
double d_a_iavl_dX=0.0;
  double lncc=0.0;
double d_lncc_dX=0.0;
  double v_bord=0.0;
double d_v_bord_dX=0.0;
  double ibi=0.0;
double d_ibi_dX=0.0;
  double ire=0.0;
double d_ire_dX=0.0;
  double ibe=0.0;
double d_ibe_dX=0.0;
  double le=0.0;
double d_le_dX=0.0;
  double DIOY=0.0;
double d_DIOY_dX=0.0;
  double qr=0.0;
double d_qr_dX=0.0;
  double tf=0.0;
double d_tf_dX=0.0;
  double qf=0.0;
double d_qf_dX=0.0;
  double dqef=0.0;
double d_dqef_dX=0.0;
  double dtef=0.0;
double d_dtef_dX=0.0;
  double dtfh=0.0;
double d_dtfh_dX=0.0;
  double dqfh=0.0;
double d_dqfh_dX=0.0;
  double tww=0.0;
double d_tww_dX=0.0;
  double w=0.0;
double d_w_dX=0.0;
  double s3=0.0;
double d_s3_dX=0.0;
  double qf0=0.0;
double d_qf0_dX=0.0;
  double itr=0.0;
double d_itr_dX=0.0;
  double itf=0.0;
double d_itf_dX=0.0;
  double qpt=0.0;
double d_qpt_dX=0.0;
  double qm=0.0;
double d_qm_dX=0.0;
  double q_p3=0.0;
double d_q_p3_dX=0.0;
  double tmp2=0.0;
double d_tmp2_dX=0.0;
  double tmp3=0.0;
double d_tmp3_dX=0.0;
  double p2_u=0.0;
double d_p2_u_dX=0.0;
  double p2_v=0.0;
double d_p2_v_dX=0.0;
  double p2_D=0.0;
double d_p2_D_dX=0.0;
  double p2_q=0.0;
double d_p2_q_dX=0.0;
  double p2_p=0.0;
double d_p2_p_dX=0.0;
  double tmp=0.0;
double d_tmp_dX=0.0;
  double p2_c=0.0;
double d_p2_c_dX=0.0;
  double p2_b=0.0;
double d_p2_b_dX=0.0;
  double p2_a=0.0;
double d_p2_a_dX=0.0;
  double o3=0.0;
  double wdc=0.0;
double d_wdc_dX=0.0;
  double aa=0.0;
double d_aa_dX=0.0;
  double a2=0.0;
double d_a2_dX=0.0;
  double a1=0.0;
double d_a1_dX=0.0;
  double diff_q=0.0;
double d_diff_q_dX=0.0;
  double qpt_h=0.0;
double d_qpt_h_dX=0.0;
  double qpt_l=0.0;
double d_qpt_l_dX=0.0;
  double qmh=0.0;
double d_qmh_dX=0.0;
  double qml=0.0;
double d_qml_dX=0.0;
  double itri=0.0;
double d_itri_dX=0.0;
  double le2=0.0;
double d_le2_dX=0.0;
  double arg2=0.0;
double d_arg2_dX=0.0;
  double itfi=0.0;
double d_itfi_dX=0.0;
  double le1=0.0;
double d_le1_dX=0.0;
  double arg1=0.0;
double d_arg1_dX=0.0;
  double ickr=0.0;
double d_ickr_dX=0.0;
  double ickf=0.0;
double d_ickf_dX=0.0;
  double denom_iqf=0.0;
double d_denom_iqf_dX=0.0;
  double tf0=0.0;
double d_tf0_dX=0.0;
  double qj_2=0.0;
double d_qj_2_dX=0.0;
  double b_q=0.0;
double d_b_q_dX=0.0;
  double qj=0.0;
double d_qj_dX=0.0;
  double qje=0.0;
double d_qje_dX=0.0;
  double h_vbe=0.0;
double d_h_vbe_dX=0.0;
  double vj_z=0.0;
double d_vj_z_dX=0.0;
  double vjh=0.0;
double d_vjh_dX=0.0;
  double cc=0.0;
double d_cc_dX=0.0;
  double ick=0.0;
double d_ick_dX=0.0;
  double vceff=0.0;
double d_vceff_dX=0.0;
  double uvc=0.0;
double d_uvc_dX=0.0;
  double vc=0.0;
double d_vc_dX=0.0;
  double cjcii=0.0;
double d_cjcii_dX=0.0;
  double dvj=0.0;
double d_dvj_dX=0.0;
  double qjcii=0.0;
double d_qjcii_dX=0.0;
  double qjci_int=0.0;
double d_qjci_int_dX=0.0;
  double qjcx=0.0;
double d_qjcx_dX=0.0;
  double qj3=0.0;
double d_qj3_dX=0.0;
  double qj2=0.0;
double d_qj2_dX=0.0;
  double qj1=0.0;
double d_qj1_dX=0.0;
  double vdj2=0.0;
double d_vdj2_dX=0.0;
  double vdj1=0.0;
double d_vdj1_dX=0.0;
  double ezr=0.0;
double d_ezr_dX=0.0;
  double ez=0.0;
double d_ez_dX=0.0;
  double vj4=0.0;
double d_vj4_dX=0.0;
  double vj2=0.0;
double d_vj2_dX=0.0;
  double vr=0.0;
double d_vr_dX=0.0;
  double vj1=0.0;
double d_vj1_dX=0.0;
  double ee1=0.0;
double d_ee1_dX=0.0;
  double ex1=0.0;
double d_ex1_dX=0.0;
  double ve=0.0;
double d_ve_dX=0.0;
  double a=0.0;
double d_a_dX=0.0;
  double cr=0.0;
double d_cr_dX=0.0;
  double cmax=0.0;
double d_cmax_dX=0.0;
  double vf=0.0;
double d_vf_dX=0.0;
  double vp=0.0;
double d_vp_dX=0.0;
  double zr=0.0;
double d_zr_dX=0.0;
  double y=0.0;
double d_y_dX=0.0;
  double x=0.0;
double d_x_dX=0.0;
  double v_j=0.0;
double d_v_j_dX=0.0;
  double xvf2=0.0;
double d_xvf2_dX=0.0;
  double xvf=0.0;
double d_xvf_dX=0.0;
  double cjcx0_t_i=0.0;
double d_cjcx0_t_i_dX=0.0;
  double qjcxi=0.0;
double d_qjcxi_dX=0.0;
  double cjci0_t_ii=0.0;
double d_cjci0_t_ii_dX=0.0;
  double cjcx0_t_ii=0.0;
double d_cjcx0_t_ii_dX=0.0;
  double ahq_t=0.0;
double d_ahq_t_dX=0.0;
  double tfh_t=0.0;
double d_tfh_t_dX=0.0;
  double iqfh_t=0.0;
double d_iqfh_t_dX=0.0;
  double ver_t=0.0;
double d_ver_t_dX=0.0;
  double aver_t=0.0;
double d_aver_t_dX=0.0;
  double rth_t=0.0;
double d_rth_t_dX=0.0;
  double kavl_t=0.0;
double d_kavl_t_dX=0.0;
  double eavl_t=0.0;
double d_eavl_t_dX=0.0;
  double re_t=0.0;
double d_re_t_dX=0.0;
  double rbi0_t=0.0;
double d_rbi0_t_dX=0.0;
  double rcx_t=0.0;
double d_rcx_t_dX=0.0;
  double rbx_t=0.0;
double d_rbx_t_dX=0.0;
  double tef0_t=0.0;
double d_tef0_t_dX=0.0;
  double dvg=0.0;
double d_dvg_dX=0.0;
  double zetatef=0.0;
double d_zetatef_dX=0.0;
  double thcs_t=0.0;
double d_thcs_t_dX=0.0;
  double t0_t=0.0;
double d_t0_t_dX=0.0;
  double vces_t=0.0;
double d_vces_t_dX=0.0;
  double vlim_t=0.0;
double d_vlim_t_dX=0.0;
  double rci0_t=0.0;
double d_rci0_t_dX=0.0;
  double iqf_t=0.0;
double d_iqf_t_dX=0.0;
  double cjs0_t=0.0;
double d_cjs0_t_dX=0.0;
  double vds_t=0.0;
double d_vds_t_dX=0.0;
  double cjcx0_t=0.0;
double d_cjcx0_t_dX=0.0;
  double vdcx_t=0.0;
double d_vdcx_t_dX=0.0;
  double cjci0_t=0.0;
double d_cjci0_t_dX=0.0;
  double vdci_t=0.0;
double d_vdci_t_dX=0.0;
  double ajedc_t=0.0;
double d_ajedc_t_dX=0.0;
  double aje_t=0.0;
double d_aje_t_dX=0.0;
  double cje0_dc_t=0.0;
double d_cje0_dc_t_dX=0.0;
  double vdedc_t=0.0;
double d_vdedc_t_dX=0.0;
  double cje0_dc=0.0;
double d_cje0_dc_dX=0.0;
  double cje0_t=0.0;
double d_cje0_t_dX=0.0;
  double vde_t=0.0;
double d_vde_t_dX=0.0;
  double vdjt=0.0;
double d_vdjt_dX=0.0;
  double vdj0=0.0;
double d_vdj0_dX=0.0;
  double arg=0.0;
double d_arg_dX=0.0;
  double iscs_t=0.0;
double d_iscs_t_dX=0.0;
  double itss_t=0.0;
double d_itss_t_dX=0.0;
  double ibcs_t=0.0;
double d_ibcs_t_dX=0.0;
  double ires_t=0.0;
double d_ires_t_dX=0.0;
  double ibes_t=0.0;
double d_ibes_t_dX=0.0;
  double is_t=0.0;
double d_is_t_dX=0.0;
  double zetasct=0.0;
double d_zetasct_dX=0.0;
  double zetabci=0.0;
double d_zetabci_dX=0.0;
  double mg=0.0;
double d_mg_dX=0.0;
  double vgsc=0.0;
double d_vgsc_dX=0.0;
  double vgbc=0.0;
double d_vgbc_dX=0.0;
  double vgbe=0.0;
double d_vgbe_dX=0.0;
  double avs=0.0;
double d_avs_dX=0.0;
  double ln_qtt0=0.0;
double d_ln_qtt0_dX=0.0;
  double qtt0=0.0;
double d_qtt0_dX=0.0;
  double dT=0.0;
double d_dT_dX=0.0;
  double VT=0.0;
double d_VT_dX=0.0;
  double vt0=0.0;
double d_vt0_dX=0.0;
  double Tdev=0.0;
double d_Tdev_dX=0.0;
  double Tamb=0.0;
  double Tnom=0.0;
double d_Tnom_dX=0.0;
  double Vrth=0.0;
  double Vbe=0.0;
double d_Vbe_dX=0.0;
  double Vbbi=0.0;
  double Vcic=0.0;
  double Veie=0.0;
  double Vsci=0.0;
double d_Vsci_dX=0.0;
  double Vciei=0.0;
double d_Vciei_dX=0.0;
  double Vbiei=0.0;
double d_Vbiei_dX=0.0;
  double Vbici=0.0;
double d_Vbici_dX=0.0;
  double Vbci=0.0;
double d_Vbci_dX=0.0;
  double HICUMtype=0.0;
double d_HICUMtype_dX=0.0;


  // -- code converted from analog/code block
d_HICUMtype_dX = 0.0;
HICUMtype = modelStruct.modelPar_type;
d_Vbci_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_b_ci]);
Vbci = (HICUMtype*(probeVars[admsProbeID_V_b_ci]));
d_Vbici_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_bi_ci]);
Vbici = (HICUMtype*(probeVars[admsProbeID_V_bi_ci]));
d_Vbiei_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_bi_ei]);
Vbiei = (HICUMtype*(probeVars[admsProbeID_V_bi_ei]));
d_Vciei_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_ci_ei]);
Vciei = (HICUMtype*(probeVars[admsProbeID_V_ci_ei]));
d_Vsci_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_s_ci]);
Vsci = (HICUMtype*(probeVars[admsProbeID_V_s_ci]));
Veie = (probeVars[admsProbeID_V_ei_e]);
Vcic = (probeVars[admsProbeID_V_ci_c]);
Vbbi = (probeVars[admsProbeID_V_b_bi]);
d_Vbe_dX = d_HICUMtype_dX*(probeVars[admsProbeID_V_b_e]);
Vbe = (HICUMtype*(probeVars[admsProbeID_V_b_e]));
Vrth = (probeVars[admsProbeID_V_tnode_GND]);
d_Tnom_dX = modelStruct.d_modelPar_tnom_dX;
Tnom = (modelStruct.modelPar_tnom+273.15);
Tamb = admsTemperature;
d_Tdev_dX = instanceStruct.d_instancePar_dt_dX;
Tdev = ((Tamb+instanceStruct.instancePar_dt)+Vrth);
if ((Tdev<((-100.00)+273.15)))
{
d_Tdev_dX = 0.0;
Tdev = ((-100.00)+273.15);
}
else
{
if ((Tdev>(326.85+273.15)))
{
d_Tdev_dX = 0.0;
Tdev = (326.85+273.15);
}
}
d_vt0_dX = (1.3806503e-23*d_Tnom_dX/1.6021766208e-19);
vt0 = ((1.3806503e-23*Tnom)/1.6021766208e-19);
d_VT_dX = (1.3806503e-23*d_Tdev_dX/1.6021766208e-19);
VT = ((1.3806503e-23*Tdev)/1.6021766208e-19);
d_dT_dX = (d_Tdev_dX-d_Tnom_dX);
dT = (Tdev-Tnom);
d_qtt0_dX = ((Tnom*d_Tdev_dX-Tdev*d_Tnom_dX)/Tnom/Tnom);
qtt0 = (Tdev/Tnom);
{
double value_log_0 = log(qtt0);
double  deriv_log_0_d0 = (1.0/qtt0);
d_ln_qtt0_dX = deriv_log_0_d0*(d_qtt0_dX);
ln_qtt0 = value_log_0;
}
d_avs_dX = (modelStruct.modelPar_alvs*d_Tnom_dX+modelStruct.d_modelPar_alvs_dX*Tnom);
avs = (modelStruct.modelPar_alvs*Tnom);
d_vgbe_dX = ((modelStruct.d_modelPar_vgb_dX+modelStruct.d_modelPar_vge_dX)/2);
vgbe = ((modelStruct.modelPar_vgb+modelStruct.modelPar_vge)/2);
d_vgbc_dX = ((modelStruct.d_modelPar_vgb_dX+modelStruct.d_modelPar_vgc_dX)/2);
vgbc = ((modelStruct.modelPar_vgb+modelStruct.modelPar_vgc)/2);
d_vgsc_dX = ((modelStruct.d_modelPar_vgs_dX+modelStruct.d_modelPar_vgc_dX)/2);
vgsc = ((modelStruct.modelPar_vgs+modelStruct.modelPar_vgc)/2);
d_mg_dX = (-(1.6021766208e-19*modelStruct.d_modelPar_f1vg_dX/1.3806503e-23));
mg = (3-((1.6021766208e-19*modelStruct.modelPar_f1vg)/1.3806503e-23));
d_zetabci_dX = (d_mg_dX-modelStruct.d_modelPar_zetaci_dX);
zetabci = ((mg+1)-modelStruct.modelPar_zetaci);
d_zetasct_dX = d_mg_dX;
zetasct = (mg-1.5);
{
double value_exp_0 = exp(((modelStruct.modelPar_zetact*ln_qtt0)+((modelStruct.modelPar_vgb/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_is_t_dX = (modelStruct.modelPar_is*deriv_exp_0_d0*(((modelStruct.modelPar_zetact*d_ln_qtt0_dX+modelStruct.d_modelPar_zetact_dX*ln_qtt0)+((modelStruct.modelPar_vgb/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_vgb_dX-modelStruct.modelPar_vgb*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_is_dX*value_exp_0);
is_t = (modelStruct.modelPar_is*value_exp_0);
}
{
double value_exp_0 = exp(((modelStruct.modelPar_zetabet*ln_qtt0)+((modelStruct.modelPar_vge/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_ibes_t_dX = (modelStruct.modelPar_ibes*deriv_exp_0_d0*(((modelStruct.modelPar_zetabet*d_ln_qtt0_dX+modelStruct.d_modelPar_zetabet_dX*ln_qtt0)+((modelStruct.modelPar_vge/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_vge_dX-modelStruct.modelPar_vge*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_ibes_dX*value_exp_0);
ibes_t = (modelStruct.modelPar_ibes*value_exp_0);
}
{
double value_exp_0 = exp((((0.5*mg)*ln_qtt0)+(((0.5*vgbe)/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_ires_t_dX = (modelStruct.modelPar_ires*deriv_exp_0_d0*((((0.5*mg)*d_ln_qtt0_dX+0.5*d_mg_dX*ln_qtt0)+(((0.5*vgbe)/VT)*d_qtt0_dX+((VT*0.5*d_vgbe_dX-(0.5*vgbe)*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_ires_dX*value_exp_0);
ires_t = (modelStruct.modelPar_ires*value_exp_0);
}
{
double value_exp_0 = exp(((zetabci*ln_qtt0)+((modelStruct.modelPar_vgc/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_ibcs_t_dX = (modelStruct.modelPar_ibcs*deriv_exp_0_d0*(((zetabci*d_ln_qtt0_dX+d_zetabci_dX*ln_qtt0)+((modelStruct.modelPar_vgc/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_vgc_dX-modelStruct.modelPar_vgc*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_ibcs_dX*value_exp_0);
ibcs_t = (modelStruct.modelPar_ibcs*value_exp_0);
}
{
double value_exp_0 = exp(((zetasct*ln_qtt0)+((modelStruct.modelPar_vgc/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_itss_t_dX = (modelStruct.modelPar_itss*deriv_exp_0_d0*(((zetasct*d_ln_qtt0_dX+d_zetasct_dX*ln_qtt0)+((modelStruct.modelPar_vgc/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_vgc_dX-modelStruct.modelPar_vgc*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_itss_dX*value_exp_0);
itss_t = (modelStruct.modelPar_itss*value_exp_0);
}
{
double value_exp_0 = exp(((zetasct*ln_qtt0)+((modelStruct.modelPar_vgs/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_iscs_t_dX = (modelStruct.modelPar_iscs*deriv_exp_0_d0*(((zetasct*d_ln_qtt0_dX+d_zetasct_dX*ln_qtt0)+((modelStruct.modelPar_vgs/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_vgs_dX-modelStruct.modelPar_vgs*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_iscs_dX*value_exp_0);
iscs_t = (modelStruct.modelPar_iscs*value_exp_0);
}
d_arg_dX = ((vt0*0.5*modelStruct.d_modelPar_vde_dX-(0.5*modelStruct.modelPar_vde)*d_vt0_dX)/vt0/vt0);
arg = ((0.5*modelStruct.modelPar_vde)/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
double  deriv_log_2_d0 = (1.0/(value_exp_0-value_exp_1));
d_vdj0_dX = ((2*vt0)*deriv_log_2_d0*((deriv_exp_0_d0*(d_arg_dX)-deriv_exp_1_d0*((-d_arg_dX))))+2*d_vt0_dX*value_log_2);
vdj0 = ((2*vt0)*value_log_2);
}
d_vdjt_dX = (((vdj0*d_qtt0_dX+d_vdj0_dX*qtt0)+(vgbe*(-d_qtt0_dX)+d_vgbe_dX*(1-qtt0)))-((mg*VT)*d_ln_qtt0_dX+(mg*d_VT_dX+d_mg_dX*VT)*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbe*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));
d_vde_t_dX = (d_vdjt_dX+((2*VT)*deriv_log_2_d0*(0.5*deriv_sqrt_1_d0*(4*deriv_exp_0_d0*(((VT*(-d_vdjt_dX)-(-vdjt)*d_VT_dX)/VT/VT))))+2*d_VT_dX*value_log_2));
vde_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log((modelStruct.modelPar_vde/vde_t));
double value_exp_1 = exp((modelStruct.modelPar_ze*value_log_0));
double  deriv_log_0_d0 = (1.0/(modelStruct.modelPar_vde/vde_t));
double  deriv_exp_1_d0 = value_exp_1;
d_cje0_t_dX = (modelStruct.modelPar_cje0*deriv_exp_1_d0*((modelStruct.modelPar_ze*deriv_log_0_d0*(((vde_t*modelStruct.d_modelPar_vde_dX-modelStruct.modelPar_vde*d_vde_t_dX)/vde_t/vde_t))+modelStruct.d_modelPar_ze_dX*value_log_0))+modelStruct.d_modelPar_cje0_dX*value_exp_1);
cje0_t = (modelStruct.modelPar_cje0*value_exp_1);
}
d_cje0_dc_dX = modelStruct.d_modelPar_cje0_dX;
cje0_dc = modelStruct.modelPar_cje0;
d_arg_dX = ((vt0*0.5*modelStruct.d_modelPar_vdedc_dX-(0.5*modelStruct.modelPar_vdedc)*d_vt0_dX)/vt0/vt0);
arg = ((0.5*modelStruct.modelPar_vdedc)/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
double  deriv_log_2_d0 = (1.0/(value_exp_0-value_exp_1));
d_vdj0_dX = ((2*vt0)*deriv_log_2_d0*((deriv_exp_0_d0*(d_arg_dX)-deriv_exp_1_d0*((-d_arg_dX))))+2*d_vt0_dX*value_log_2);
vdj0 = ((2*vt0)*value_log_2);
}
d_vdjt_dX = (((vdj0*d_qtt0_dX+d_vdj0_dX*qtt0)+(vgbe*(-d_qtt0_dX)+d_vgbe_dX*(1-qtt0)))-((mg*VT)*d_ln_qtt0_dX+(mg*d_VT_dX+d_mg_dX*VT)*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbe*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));
d_vdedc_t_dX = (d_vdjt_dX+((2*VT)*deriv_log_2_d0*(0.5*deriv_sqrt_1_d0*(4*deriv_exp_0_d0*(((VT*(-d_vdjt_dX)-(-vdjt)*d_VT_dX)/VT/VT))))+2*d_VT_dX*value_log_2));
vdedc_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log((modelStruct.modelPar_vdedc/vdedc_t));
double value_exp_1 = exp((modelStruct.modelPar_zedc*value_log_0));
double  deriv_log_0_d0 = (1.0/(modelStruct.modelPar_vdedc/vdedc_t));
double  deriv_exp_1_d0 = value_exp_1;
d_cje0_dc_t_dX = (cje0_dc*deriv_exp_1_d0*((modelStruct.modelPar_zedc*deriv_log_0_d0*(((vdedc_t*modelStruct.d_modelPar_vdedc_dX-modelStruct.modelPar_vdedc*d_vdedc_t_dX)/vdedc_t/vdedc_t))+modelStruct.d_modelPar_zedc_dX*value_log_0))+d_cje0_dc_dX*value_exp_1);
cje0_dc_t = (cje0_dc*value_exp_1);
}
d_aje_t_dX = ((modelStruct.modelPar_vde*(modelStruct.modelPar_aje*d_vde_t_dX+modelStruct.d_modelPar_aje_dX*vde_t)-(modelStruct.modelPar_aje*vde_t)*modelStruct.d_modelPar_vde_dX)/modelStruct.modelPar_vde/modelStruct.modelPar_vde);
aje_t = ((modelStruct.modelPar_aje*vde_t)/modelStruct.modelPar_vde);
d_ajedc_t_dX = ((modelStruct.modelPar_vdedc*(modelStruct.modelPar_ajedc*d_vdedc_t_dX+modelStruct.d_modelPar_ajedc_dX*vdedc_t)-(modelStruct.modelPar_ajedc*vdedc_t)*modelStruct.d_modelPar_vdedc_dX)/modelStruct.modelPar_vdedc/modelStruct.modelPar_vdedc);
ajedc_t = ((modelStruct.modelPar_ajedc*vdedc_t)/modelStruct.modelPar_vdedc);
d_arg_dX = ((vt0*0.5*modelStruct.d_modelPar_vdci_dX-(0.5*modelStruct.modelPar_vdci)*d_vt0_dX)/vt0/vt0);
arg = ((0.5*modelStruct.modelPar_vdci)/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
double  deriv_log_2_d0 = (1.0/(value_exp_0-value_exp_1));
d_vdj0_dX = ((2*vt0)*deriv_log_2_d0*((deriv_exp_0_d0*(d_arg_dX)-deriv_exp_1_d0*((-d_arg_dX))))+2*d_vt0_dX*value_log_2);
vdj0 = ((2*vt0)*value_log_2);
}
d_vdjt_dX = (((vdj0*d_qtt0_dX+d_vdj0_dX*qtt0)+(vgbc*(-d_qtt0_dX)+d_vgbc_dX*(1-qtt0)))-((mg*VT)*d_ln_qtt0_dX+(mg*d_VT_dX+d_mg_dX*VT)*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));
d_vdci_t_dX = (d_vdjt_dX+((2*VT)*deriv_log_2_d0*(0.5*deriv_sqrt_1_d0*(4*deriv_exp_0_d0*(((VT*(-d_vdjt_dX)-(-vdjt)*d_VT_dX)/VT/VT))))+2*d_VT_dX*value_log_2));
vdci_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log((modelStruct.modelPar_vdci/vdci_t));
double value_exp_1 = exp((modelStruct.modelPar_zci*value_log_0));
double  deriv_log_0_d0 = (1.0/(modelStruct.modelPar_vdci/vdci_t));
double  deriv_exp_1_d0 = value_exp_1;
d_cjci0_t_dX = (modelStruct.modelPar_cjci0*deriv_exp_1_d0*((modelStruct.modelPar_zci*deriv_log_0_d0*(((vdci_t*modelStruct.d_modelPar_vdci_dX-modelStruct.modelPar_vdci*d_vdci_t_dX)/vdci_t/vdci_t))+modelStruct.d_modelPar_zci_dX*value_log_0))+modelStruct.d_modelPar_cjci0_dX*value_exp_1);
cjci0_t = (modelStruct.modelPar_cjci0*value_exp_1);
}
d_arg_dX = ((vt0*0.5*modelStruct.d_modelPar_vdcx_dX-(0.5*modelStruct.modelPar_vdcx)*d_vt0_dX)/vt0/vt0);
arg = ((0.5*modelStruct.modelPar_vdcx)/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
double  deriv_log_2_d0 = (1.0/(value_exp_0-value_exp_1));
d_vdj0_dX = ((2*vt0)*deriv_log_2_d0*((deriv_exp_0_d0*(d_arg_dX)-deriv_exp_1_d0*((-d_arg_dX))))+2*d_vt0_dX*value_log_2);
vdj0 = ((2*vt0)*value_log_2);
}
d_vdjt_dX = (((vdj0*d_qtt0_dX+d_vdj0_dX*qtt0)+(vgbc*(-d_qtt0_dX)+d_vgbc_dX*(1-qtt0)))-((mg*VT)*d_ln_qtt0_dX+(mg*d_VT_dX+d_mg_dX*VT)*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgbc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));
d_vdcx_t_dX = (d_vdjt_dX+((2*VT)*deriv_log_2_d0*(0.5*deriv_sqrt_1_d0*(4*deriv_exp_0_d0*(((VT*(-d_vdjt_dX)-(-vdjt)*d_VT_dX)/VT/VT))))+2*d_VT_dX*value_log_2));
vdcx_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log((modelStruct.modelPar_vdcx/vdcx_t));
double value_exp_1 = exp((modelStruct.modelPar_zcx*value_log_0));
double  deriv_log_0_d0 = (1.0/(modelStruct.modelPar_vdcx/vdcx_t));
double  deriv_exp_1_d0 = value_exp_1;
d_cjcx0_t_dX = (modelStruct.modelPar_cjcx0*deriv_exp_1_d0*((modelStruct.modelPar_zcx*deriv_log_0_d0*(((vdcx_t*modelStruct.d_modelPar_vdcx_dX-modelStruct.modelPar_vdcx*d_vdcx_t_dX)/vdcx_t/vdcx_t))+modelStruct.d_modelPar_zcx_dX*value_log_0))+modelStruct.d_modelPar_cjcx0_dX*value_exp_1);
cjcx0_t = (modelStruct.modelPar_cjcx0*value_exp_1);
}
d_arg_dX = ((vt0*0.5*modelStruct.d_modelPar_vds_dX-(0.5*modelStruct.modelPar_vds)*d_vt0_dX)/vt0/vt0);
arg = ((0.5*modelStruct.modelPar_vds)/vt0);
{
double value_exp_0 = exp(arg);
double value_exp_1 = exp((-arg));
double value_log_2 = log((value_exp_0-value_exp_1));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
double  deriv_log_2_d0 = (1.0/(value_exp_0-value_exp_1));
d_vdj0_dX = ((2*vt0)*deriv_log_2_d0*((deriv_exp_0_d0*(d_arg_dX)-deriv_exp_1_d0*((-d_arg_dX))))+2*d_vt0_dX*value_log_2);
vdj0 = ((2*vt0)*value_log_2);
}
d_vdjt_dX = (((vdj0*d_qtt0_dX+d_vdj0_dX*qtt0)+(vgsc*(-d_qtt0_dX)+d_vgsc_dX*(1-qtt0)))-((mg*VT)*d_ln_qtt0_dX+(mg*d_VT_dX+d_mg_dX*VT)*ln_qtt0));
vdjt = (((vdj0*qtt0)+(vgsc*(1-qtt0)))-((mg*VT)*ln_qtt0));
{
double value_exp_0 = exp(((-vdjt)/VT));
double value_sqrt_1 = sqrt((1+(4*value_exp_0)));
double value_log_2 = log((0.5*(1+value_sqrt_1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
double  deriv_log_2_d0 = (1.0/(0.5*(1+value_sqrt_1)));
d_vds_t_dX = (d_vdjt_dX+((2*VT)*deriv_log_2_d0*(0.5*deriv_sqrt_1_d0*(4*deriv_exp_0_d0*(((VT*(-d_vdjt_dX)-(-vdjt)*d_VT_dX)/VT/VT))))+2*d_VT_dX*value_log_2));
vds_t = (vdjt+((2*VT)*value_log_2));
}
{
double value_log_0 = log((modelStruct.modelPar_vds/vds_t));
double value_exp_1 = exp((modelStruct.modelPar_zs*value_log_0));
double  deriv_log_0_d0 = (1.0/(modelStruct.modelPar_vds/vds_t));
double  deriv_exp_1_d0 = value_exp_1;
d_cjs0_t_dX = (modelStruct.modelPar_cjs0*deriv_exp_1_d0*((modelStruct.modelPar_zs*deriv_log_0_d0*(((vds_t*modelStruct.d_modelPar_vds_dX-modelStruct.modelPar_vds*d_vds_t_dX)/vds_t/vds_t))+modelStruct.d_modelPar_zs_dX*value_log_0))+modelStruct.d_modelPar_cjs0_dX*value_exp_1);
cjs0_t = (modelStruct.modelPar_cjs0*value_exp_1);
}
{
double value_exp_0 = exp(((modelStruct.modelPar_zetaiqf*ln_qtt0)-((modelStruct.modelPar_dvgbe/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_iqf_t_dX = (modelStruct.modelPar_iqf*deriv_exp_0_d0*(((modelStruct.modelPar_zetaiqf*d_ln_qtt0_dX+modelStruct.d_modelPar_zetaiqf_dX*ln_qtt0)-((modelStruct.modelPar_dvgbe/VT)*d_qtt0_dX+((VT*modelStruct.d_modelPar_dvgbe_dX-modelStruct.modelPar_dvgbe*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_iqf_dX*value_exp_0);
iqf_t = (modelStruct.modelPar_iqf*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetaci*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_rci0_t_dX = (modelStruct.modelPar_rci0*deriv_exp_0_d0*((modelStruct.modelPar_zetaci*d_ln_qtt0_dX+modelStruct.d_modelPar_zetaci_dX*ln_qtt0))+modelStruct.d_modelPar_rci0_dX*value_exp_0);
rci0_t = (modelStruct.modelPar_rci0*value_exp_0);
}
{
double value_exp_0 = exp(((modelStruct.modelPar_zetaci-avs)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_vlim_t_dX = (modelStruct.modelPar_vlim*deriv_exp_0_d0*(((modelStruct.modelPar_zetaci-avs)*d_ln_qtt0_dX+(modelStruct.d_modelPar_zetaci_dX-d_avs_dX)*ln_qtt0))+modelStruct.d_modelPar_vlim_dX*value_exp_0);
vlim_t = (modelStruct.modelPar_vlim*value_exp_0);
}
d_vces_t_dX = (modelStruct.modelPar_vces*(modelStruct.modelPar_alces*d_dT_dX+modelStruct.d_modelPar_alces_dX*dT)+modelStruct.d_modelPar_vces_dX*(1+(modelStruct.modelPar_alces*dT)));
vces_t = (modelStruct.modelPar_vces*(1+(modelStruct.modelPar_alces*dT)));
d_t0_t_dX = (modelStruct.modelPar_t0*((modelStruct.modelPar_alt0*d_dT_dX+modelStruct.d_modelPar_alt0_dX*dT)+((modelStruct.modelPar_kt0*dT)*d_dT_dX+(modelStruct.modelPar_kt0*d_dT_dX+modelStruct.d_modelPar_kt0_dX*dT)*dT))+modelStruct.d_modelPar_t0_dX*((1+(modelStruct.modelPar_alt0*dT))+((modelStruct.modelPar_kt0*dT)*dT)));
t0_t = (modelStruct.modelPar_t0*((1+(modelStruct.modelPar_alt0*dT))+((modelStruct.modelPar_kt0*dT)*dT)));
{
double value_exp_0 = exp(((modelStruct.modelPar_zetaci-1)*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_thcs_t_dX = (modelStruct.modelPar_thcs*deriv_exp_0_d0*(((modelStruct.modelPar_zetaci-1)*d_ln_qtt0_dX+modelStruct.d_modelPar_zetaci_dX*ln_qtt0))+modelStruct.d_modelPar_thcs_dX*value_exp_0);
thcs_t = (modelStruct.modelPar_thcs*value_exp_0);
}
d_zetatef_dX = (modelStruct.d_modelPar_zetabet_dX-modelStruct.d_modelPar_zetact_dX);
zetatef = ((modelStruct.modelPar_zetabet-modelStruct.modelPar_zetact)-0.5);
d_dvg_dX = (modelStruct.d_modelPar_vgb_dX-modelStruct.d_modelPar_vge_dX);
dvg = (modelStruct.modelPar_vgb-modelStruct.modelPar_vge);
if ((modelStruct.modelPar_tef_temp==1))
{
{
double value_exp_0 = exp(((zetatef*ln_qtt0)-((dvg/VT)*(qtt0-1))));
double  deriv_exp_0_d0 = value_exp_0;
d_tef0_t_dX = (modelStruct.modelPar_tef0*deriv_exp_0_d0*(((zetatef*d_ln_qtt0_dX+d_zetatef_dX*ln_qtt0)-((dvg/VT)*d_qtt0_dX+((VT*d_dvg_dX-dvg*d_VT_dX)/VT/VT)*(qtt0-1))))+modelStruct.d_modelPar_tef0_dX*value_exp_0);
tef0_t = (modelStruct.modelPar_tef0*value_exp_0);
}
}
else
{
d_tef0_t_dX = modelStruct.d_modelPar_tef0_dX;
tef0_t = modelStruct.modelPar_tef0;
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetarbx*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_rbx_t_dX = (modelStruct.modelPar_rbx*deriv_exp_0_d0*((modelStruct.modelPar_zetarbx*d_ln_qtt0_dX+modelStruct.d_modelPar_zetarbx_dX*ln_qtt0))+modelStruct.d_modelPar_rbx_dX*value_exp_0);
rbx_t = (modelStruct.modelPar_rbx*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetarcx*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_rcx_t_dX = (modelStruct.modelPar_rcx*deriv_exp_0_d0*((modelStruct.modelPar_zetarcx*d_ln_qtt0_dX+modelStruct.d_modelPar_zetarcx_dX*ln_qtt0))+modelStruct.d_modelPar_rcx_dX*value_exp_0);
rcx_t = (modelStruct.modelPar_rcx*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetarbi*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_rbi0_t_dX = (modelStruct.modelPar_rbi0*deriv_exp_0_d0*((modelStruct.modelPar_zetarbi*d_ln_qtt0_dX+modelStruct.d_modelPar_zetarbi_dX*ln_qtt0))+modelStruct.d_modelPar_rbi0_dX*value_exp_0);
rbi0_t = (modelStruct.modelPar_rbi0*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetare*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_re_t_dX = (modelStruct.modelPar_re*deriv_exp_0_d0*((modelStruct.modelPar_zetare*d_ln_qtt0_dX+modelStruct.d_modelPar_zetare_dX*ln_qtt0))+modelStruct.d_modelPar_re_dX*value_exp_0);
re_t = (modelStruct.modelPar_re*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_aleav*dT));
double  deriv_exp_0_d0 = value_exp_0;
d_eavl_t_dX = (modelStruct.modelPar_eavl*deriv_exp_0_d0*((modelStruct.modelPar_aleav*d_dT_dX+modelStruct.d_modelPar_aleav_dX*dT))+modelStruct.d_modelPar_eavl_dX*value_exp_0);
eavl_t = (modelStruct.modelPar_eavl*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_alkav*dT));
double  deriv_exp_0_d0 = value_exp_0;
d_kavl_t_dX = (modelStruct.modelPar_kavl*deriv_exp_0_d0*((modelStruct.modelPar_alkav*d_dT_dX+modelStruct.d_modelPar_alkav_dX*dT))+modelStruct.d_modelPar_kavl_dX*value_exp_0);
kavl_t = (modelStruct.modelPar_kavl*value_exp_0);
}
if ((modelStruct.modelPar_zetarth!=0))
{
{
double value_log_0 = log((Tdev/Tnom));
double value_exp_1 = exp((modelStruct.modelPar_zetarth*value_log_0));
double  deriv_log_0_d0 = (1.0/(Tdev/Tnom));
double  deriv_exp_1_d0 = value_exp_1;
d_rth_t_dX = (modelStruct.modelPar_rth*deriv_exp_1_d0*((modelStruct.modelPar_zetarth*deriv_log_0_d0*(((Tnom*d_Tdev_dX-Tdev*d_Tnom_dX)/Tnom/Tnom))+modelStruct.d_modelPar_zetarth_dX*value_log_0))+modelStruct.d_modelPar_rth_dX*value_exp_1);
rth_t = (modelStruct.modelPar_rth*value_exp_1);
}
}
else
{
d_rth_t_dX = modelStruct.d_modelPar_rth_dX;
rth_t = modelStruct.modelPar_rth;
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetaver*ln_qtt0));
double  deriv_exp_0_d0 = value_exp_0;
d_aver_t_dX = (modelStruct.modelPar_aver*deriv_exp_0_d0*((modelStruct.modelPar_zetaver*d_ln_qtt0_dX+modelStruct.d_modelPar_zetaver_dX*ln_qtt0))+modelStruct.d_modelPar_aver_dX*value_exp_0);
aver_t = (modelStruct.modelPar_aver*value_exp_0);
}
{
double value_exp_0 = exp((modelStruct.modelPar_zetavgbe*ln_qtt0));
double value_exp_1 = exp(((modelStruct.modelPar_dvgbe/VT)*(value_exp_0-1)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
d_ver_t_dX = ((value_exp_1*modelStruct.d_modelPar_ver_dX-modelStruct.modelPar_ver*deriv_exp_1_d0*(((modelStruct.modelPar_dvgbe/VT)*deriv_exp_0_d0*((modelStruct.modelPar_zetavgbe*d_ln_qtt0_dX+modelStruct.d_modelPar_zetavgbe_dX*ln_qtt0))+((VT*modelStruct.d_modelPar_dvgbe_dX-modelStruct.modelPar_dvgbe*d_VT_dX)/VT/VT)*(value_exp_0-1))))/value_exp_1/value_exp_1);
ver_t = (modelStruct.modelPar_ver/value_exp_1);
}
d_iqfh_t_dX = (modelStruct.modelPar_iqfh*((modelStruct.modelPar_aliqfh*d_dT_dX+modelStruct.d_modelPar_aliqfh_dX*dT)+((modelStruct.modelPar_kiqfh*dT)*d_dT_dX+(modelStruct.modelPar_kiqfh*d_dT_dX+modelStruct.d_modelPar_kiqfh_dX*dT)*dT))+modelStruct.d_modelPar_iqfh_dX*((1+(modelStruct.modelPar_aliqfh*dT))+((modelStruct.modelPar_kiqfh*dT)*dT)));
iqfh_t = (modelStruct.modelPar_iqfh*((1+(modelStruct.modelPar_aliqfh*dT))+((modelStruct.modelPar_kiqfh*dT)*dT)));
{
double value_exp_0 = exp((((modelStruct.modelPar_vgb-modelStruct.modelPar_vge)/VT)*(qtt0-1)));
double  deriv_exp_0_d0 = value_exp_0;
d_tfh_t_dX = ((modelStruct.modelPar_tfh*((1+(modelStruct.modelPar_aliqfh*dT))+((modelStruct.modelPar_kiqfh*dT)*dT)))*deriv_exp_0_d0*((((modelStruct.modelPar_vgb-modelStruct.modelPar_vge)/VT)*d_qtt0_dX+((VT*(modelStruct.d_modelPar_vgb_dX-modelStruct.d_modelPar_vge_dX)-(modelStruct.modelPar_vgb-modelStruct.modelPar_vge)*d_VT_dX)/VT/VT)*(qtt0-1)))+(modelStruct.modelPar_tfh*((modelStruct.modelPar_aliqfh*d_dT_dX+modelStruct.d_modelPar_aliqfh_dX*dT)+((modelStruct.modelPar_kiqfh*dT)*d_dT_dX+(modelStruct.modelPar_kiqfh*d_dT_dX+modelStruct.d_modelPar_kiqfh_dX*dT)*dT))+modelStruct.d_modelPar_tfh_dX*((1+(modelStruct.modelPar_aliqfh*dT))+((modelStruct.modelPar_kiqfh*dT)*dT)))*value_exp_0);
tfh_t = ((modelStruct.modelPar_tfh*((1+(modelStruct.modelPar_aliqfh*dT))+((modelStruct.modelPar_kiqfh*dT)*dT)))*value_exp_0);
}
d_ahq_t_dX = modelStruct.d_modelPar_ahq_dX;
ahq_t = modelStruct.modelPar_ahq;
if ((cjcx0_t==0))
{
d_cjci0_t_ii_dX = (cjci0_t*modelStruct.d_modelPar_fbc_dX+d_cjci0_t_dX*modelStruct.modelPar_fbc);
cjci0_t_ii = (cjci0_t*modelStruct.modelPar_fbc);
d_qjcxi_dX = 0.0;
qjcxi = 0;
d_cjcx0_t_i_dX = (cjci0_t*(-modelStruct.d_modelPar_fbc_dX)+d_cjci0_t_dX*(1-modelStruct.modelPar_fbc));
cjcx0_t_i = (cjci0_t*(1-modelStruct.modelPar_fbc));
if ((modelStruct.modelPar_vptci<1.0e2))
{
if ((cjcx0_t_i>0.0))
{
d_zr_dX = (modelStruct.d_modelPar_zci_dX/4.0);
zr = (modelStruct.modelPar_zci/4.0);
d_vp_dX = (modelStruct.d_modelPar_vptci_dX-d_vdci_t_dX);
vp = (modelStruct.modelPar_vptci-vdci_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zci));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdci_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)))+d_vdci_t_dX*(1.0-value_exp_1));
vf = (vdci_t*(1.0-value_exp_1));
}
d_cmax_dX = 2.4*d_cjcx0_t_i_dX;
cmax = (2.4*cjcx0_t_i);
{
double value_log_0 = log((vdci_t/modelStruct.modelPar_vptci));
double value_exp_1 = exp(((modelStruct.modelPar_zci-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdci_t/modelStruct.modelPar_vptci));
double  deriv_exp_1_d0 = value_exp_1;
d_cr_dX = (cjcx0_t_i*deriv_exp_1_d0*(((modelStruct.modelPar_zci-zr)*deriv_log_0_d0*(((modelStruct.modelPar_vptci*d_vdci_t_dX-vdci_t*modelStruct.d_modelPar_vptci_dX)/modelStruct.modelPar_vptci/modelStruct.modelPar_vptci))+(modelStruct.d_modelPar_zci_dX-d_zr_dX)*value_log_0))+d_cjcx0_t_i_dX*value_exp_1);
cr = (cjcx0_t_i*value_exp_1);
}
d_a_dX = d_VT_dX;
a = VT;
d_ve_dX = ((a*(d_vf_dX-d_Vbci_dX)-(vf-Vbci)*d_a_dX)/a/a);
ve = ((vf-Vbci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_ve_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj1_dX = (d_vf_dX-(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{
d_vj1_dX = d_Vbci_dX;
vj1 = Vbci;
}
d_a_dX = (0.1*d_vp_dX+4.0*d_VT_dX);
a = ((0.1*vp)+(4.0*VT));
d_vr_dX = ((a*(d_vp_dX+d_vj1_dX)-(vp+vj1)*d_a_dX)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_vr_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj2_dX = ((-d_vp_dX)+(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{
d_vj2_dX = d_vj1_dX;
vj2 = vj1;
}
d_vj4_dX = (d_Vbci_dX-d_vj1_dX);
vj4 = (Vbci-vj1);
d_ez_dX = (-modelStruct.d_modelPar_zci_dX);
ez = (1.0-modelStruct.modelPar_zci);
d_ezr_dX = (-d_zr_dX);
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdci_t)));
d_vdj1_dX = deriv_log_0_d0*((-((vdci_t*d_vj1_dX-vj1*d_vdci_t_dX)/vdci_t/vdci_t)));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdci_t)));
d_vdj2_dX = deriv_log_0_d0*((-((vdci_t*d_vj2_dX-vj2*d_vdci_t_dX)/vdci_t/vdci_t)));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;
d_qj1_dX = ((ez*(cjcx0_t_i*(-deriv_exp_0_d0*((vdj2*d_ez_dX+d_vdj2_dX*ez)))+d_cjcx0_t_i_dX*(1.0-value_exp_0))-(cjcx0_t_i*(1.0-value_exp_0))*d_ez_dX)/ez/ez);
qj1 = ((cjcx0_t_i*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj2_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj1*d_ezr_dX+d_vdj1_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj3_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj2*d_ezr_dX+d_vdj2_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}
d_qjcx_dX = ((((qj1+qj2)-qj3)*d_vdci_t_dX+((d_qj1_dX+d_qj2_dX)-d_qj3_dX)*vdci_t)+(cmax*d_vj4_dX+d_cmax_dX*vj4));
qjcx = ((((qj1+qj2)-qj3)*vdci_t)+(cmax*vj4));
}
else
{
d_qjcx_dX = 0.0;
qjcx = 0.0;
}
}
else
{
if ((cjcx0_t_i>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zci));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdci_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)))+d_vdci_t_dX*(1.0-value_exp_1));
vf = (vdci_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbci_dX)-(vf-Vbci)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zci_dX);
x = (1.0-modelStruct.modelPar_zci);
{
double value_log_0 = log((1.0-(v_j/vdci_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vdci_t*d_v_j_dX-v_j*d_vdci_t_dX)/vdci_t/vdci_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
d_qjcx_dX = (((x*((cjcx0_t_i*vdci_t)*d_y_dX+(cjcx0_t_i*d_vdci_t_dX+d_cjcx0_t_i_dX*vdci_t)*y)-((cjcx0_t_i*vdci_t)*y)*d_x_dX)/x/x)+((2.4*cjcx0_t_i)*(d_Vbci_dX-d_v_j_dX)+2.4*d_cjcx0_t_i_dX*(Vbci-v_j)));
qjcx = ((((cjcx0_t_i*vdci_t)*y)/x)+((2.4*cjcx0_t_i)*(Vbci-v_j)));
}
else
{
d_qjcx_dX = 0.0;
qjcx = 0.00;
}
}
}
else
{
d_cjci0_t_ii_dX = d_cjci0_t_dX;
cjci0_t_ii = cjci0_t;
d_cjcx0_t_ii_dX = (cjcx0_t*modelStruct.d_modelPar_fbc_dX+d_cjcx0_t_dX*modelStruct.modelPar_fbc);
cjcx0_t_ii = (cjcx0_t*modelStruct.modelPar_fbc);
if ((modelStruct.modelPar_vptcx<1.0e2))
{
if ((cjcx0_t_ii>0.0))
{
d_zr_dX = (modelStruct.d_modelPar_zcx_dX/4.0);
zr = (modelStruct.modelPar_zcx/4.0);
d_vp_dX = (modelStruct.d_modelPar_vptcx_dX-d_vdcx_t_dX);
vp = (modelStruct.modelPar_vptcx-vdcx_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zcx));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdcx_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zcx_dX/modelStruct.modelPar_zcx/modelStruct.modelPar_zcx)))+d_vdcx_t_dX*(1.0-value_exp_1));
vf = (vdcx_t*(1.0-value_exp_1));
}
d_cmax_dX = 2.4*d_cjcx0_t_ii_dX;
cmax = (2.4*cjcx0_t_ii);
{
double value_log_0 = log((vdcx_t/modelStruct.modelPar_vptcx));
double value_exp_1 = exp(((modelStruct.modelPar_zcx-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdcx_t/modelStruct.modelPar_vptcx));
double  deriv_exp_1_d0 = value_exp_1;
d_cr_dX = (cjcx0_t_ii*deriv_exp_1_d0*(((modelStruct.modelPar_zcx-zr)*deriv_log_0_d0*(((modelStruct.modelPar_vptcx*d_vdcx_t_dX-vdcx_t*modelStruct.d_modelPar_vptcx_dX)/modelStruct.modelPar_vptcx/modelStruct.modelPar_vptcx))+(modelStruct.d_modelPar_zcx_dX-d_zr_dX)*value_log_0))+d_cjcx0_t_ii_dX*value_exp_1);
cr = (cjcx0_t_ii*value_exp_1);
}
d_a_dX = d_VT_dX;
a = VT;
d_ve_dX = ((a*(d_vf_dX-d_Vbici_dX)-(vf-Vbici)*d_a_dX)/a/a);
ve = ((vf-Vbici)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_ve_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj1_dX = (d_vf_dX-(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{
d_vj1_dX = d_Vbici_dX;
vj1 = Vbici;
}
d_a_dX = (0.1*d_vp_dX+4.0*d_VT_dX);
a = ((0.1*vp)+(4.0*VT));
d_vr_dX = ((a*(d_vp_dX+d_vj1_dX)-(vp+vj1)*d_a_dX)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_vr_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj2_dX = ((-d_vp_dX)+(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{
d_vj2_dX = d_vj1_dX;
vj2 = vj1;
}
d_vj4_dX = (d_Vbici_dX-d_vj1_dX);
vj4 = (Vbici-vj1);
d_ez_dX = (-modelStruct.d_modelPar_zcx_dX);
ez = (1.0-modelStruct.modelPar_zcx);
d_ezr_dX = (-d_zr_dX);
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdcx_t)));
d_vdj1_dX = deriv_log_0_d0*((-((vdcx_t*d_vj1_dX-vj1*d_vdcx_t_dX)/vdcx_t/vdcx_t)));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdcx_t)));
d_vdj2_dX = deriv_log_0_d0*((-((vdcx_t*d_vj2_dX-vj2*d_vdcx_t_dX)/vdcx_t/vdcx_t)));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;
d_qj1_dX = ((ez*(cjcx0_t_ii*(-deriv_exp_0_d0*((vdj2*d_ez_dX+d_vdj2_dX*ez)))+d_cjcx0_t_ii_dX*(1.0-value_exp_0))-(cjcx0_t_ii*(1.0-value_exp_0))*d_ez_dX)/ez/ez);
qj1 = ((cjcx0_t_ii*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj2_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj1*d_ezr_dX+d_vdj1_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj3_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj2*d_ezr_dX+d_vdj2_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}
d_qjcxi_dX = ((((qj1+qj2)-qj3)*d_vdcx_t_dX+((d_qj1_dX+d_qj2_dX)-d_qj3_dX)*vdcx_t)+(cmax*d_vj4_dX+d_cmax_dX*vj4));
qjcxi = ((((qj1+qj2)-qj3)*vdcx_t)+(cmax*vj4));
}
else
{
d_qjcxi_dX = 0.0;
qjcxi = 0.0;
}
}
else
{
if ((cjcx0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zcx));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdcx_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zcx_dX/modelStruct.modelPar_zcx/modelStruct.modelPar_zcx)))+d_vdcx_t_dX*(1.0-value_exp_1));
vf = (vdcx_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbici_dX)-(vf-Vbici)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zcx_dX);
x = (1.0-modelStruct.modelPar_zcx);
{
double value_log_0 = log((1.0-(v_j/vdcx_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdcx_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vdcx_t*d_v_j_dX-v_j*d_vdcx_t_dX)/vdcx_t/vdcx_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
d_qjcxi_dX = (((x*((cjcx0_t_ii*vdcx_t)*d_y_dX+(cjcx0_t_ii*d_vdcx_t_dX+d_cjcx0_t_ii_dX*vdcx_t)*y)-((cjcx0_t_ii*vdcx_t)*y)*d_x_dX)/x/x)+((2.4*cjcx0_t_ii)*(d_Vbici_dX-d_v_j_dX)+2.4*d_cjcx0_t_ii_dX*(Vbici-v_j)));
qjcxi = ((((cjcx0_t_ii*vdcx_t)*y)/x)+((2.4*cjcx0_t_ii)*(Vbici-v_j)));
}
else
{
d_qjcxi_dX = 0.0;
qjcxi = 0.00;
}
}
d_cjcx0_t_i_dX = (cjcx0_t*(-modelStruct.d_modelPar_fbc_dX)+d_cjcx0_t_dX*(1-modelStruct.modelPar_fbc));
cjcx0_t_i = (cjcx0_t*(1-modelStruct.modelPar_fbc));
if ((modelStruct.modelPar_vptcx<1.0e2))
{
if ((cjcx0_t_i>0.0))
{
d_zr_dX = (modelStruct.d_modelPar_zcx_dX/4.0);
zr = (modelStruct.modelPar_zcx/4.0);
d_vp_dX = (modelStruct.d_modelPar_vptcx_dX-d_vdcx_t_dX);
vp = (modelStruct.modelPar_vptcx-vdcx_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zcx));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdcx_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zcx_dX/modelStruct.modelPar_zcx/modelStruct.modelPar_zcx)))+d_vdcx_t_dX*(1.0-value_exp_1));
vf = (vdcx_t*(1.0-value_exp_1));
}
d_cmax_dX = 2.4*d_cjcx0_t_i_dX;
cmax = (2.4*cjcx0_t_i);
{
double value_log_0 = log((vdcx_t/modelStruct.modelPar_vptcx));
double value_exp_1 = exp(((modelStruct.modelPar_zcx-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdcx_t/modelStruct.modelPar_vptcx));
double  deriv_exp_1_d0 = value_exp_1;
d_cr_dX = (cjcx0_t_i*deriv_exp_1_d0*(((modelStruct.modelPar_zcx-zr)*deriv_log_0_d0*(((modelStruct.modelPar_vptcx*d_vdcx_t_dX-vdcx_t*modelStruct.d_modelPar_vptcx_dX)/modelStruct.modelPar_vptcx/modelStruct.modelPar_vptcx))+(modelStruct.d_modelPar_zcx_dX-d_zr_dX)*value_log_0))+d_cjcx0_t_i_dX*value_exp_1);
cr = (cjcx0_t_i*value_exp_1);
}
d_a_dX = d_VT_dX;
a = VT;
d_ve_dX = ((a*(d_vf_dX-d_Vbci_dX)-(vf-Vbci)*d_a_dX)/a/a);
ve = ((vf-Vbci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_ve_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj1_dX = (d_vf_dX-(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{
d_vj1_dX = d_Vbci_dX;
vj1 = Vbci;
}
d_a_dX = (0.1*d_vp_dX+4.0*d_VT_dX);
a = ((0.1*vp)+(4.0*VT));
d_vr_dX = ((a*(d_vp_dX+d_vj1_dX)-(vp+vj1)*d_a_dX)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_vr_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj2_dX = ((-d_vp_dX)+(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{
d_vj2_dX = d_vj1_dX;
vj2 = vj1;
}
d_vj4_dX = (d_Vbci_dX-d_vj1_dX);
vj4 = (Vbci-vj1);
d_ez_dX = (-modelStruct.d_modelPar_zcx_dX);
ez = (1.0-modelStruct.modelPar_zcx);
d_ezr_dX = (-d_zr_dX);
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdcx_t)));
d_vdj1_dX = deriv_log_0_d0*((-((vdcx_t*d_vj1_dX-vj1*d_vdcx_t_dX)/vdcx_t/vdcx_t)));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdcx_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdcx_t)));
d_vdj2_dX = deriv_log_0_d0*((-((vdcx_t*d_vj2_dX-vj2*d_vdcx_t_dX)/vdcx_t/vdcx_t)));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;
d_qj1_dX = ((ez*(cjcx0_t_i*(-deriv_exp_0_d0*((vdj2*d_ez_dX+d_vdj2_dX*ez)))+d_cjcx0_t_i_dX*(1.0-value_exp_0))-(cjcx0_t_i*(1.0-value_exp_0))*d_ez_dX)/ez/ez);
qj1 = ((cjcx0_t_i*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj2_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj1*d_ezr_dX+d_vdj1_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj3_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj2*d_ezr_dX+d_vdj2_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}
d_qjcx_dX = ((((qj1+qj2)-qj3)*d_vdcx_t_dX+((d_qj1_dX+d_qj2_dX)-d_qj3_dX)*vdcx_t)+(cmax*d_vj4_dX+d_cmax_dX*vj4));
qjcx = ((((qj1+qj2)-qj3)*vdcx_t)+(cmax*vj4));
}
else
{
d_qjcx_dX = 0.0;
qjcx = 0.0;
}
}
else
{
if ((cjcx0_t_i>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zcx));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdcx_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zcx_dX/modelStruct.modelPar_zcx/modelStruct.modelPar_zcx)))+d_vdcx_t_dX*(1.0-value_exp_1));
vf = (vdcx_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbci_dX)-(vf-Vbci)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zcx_dX);
x = (1.0-modelStruct.modelPar_zcx);
{
double value_log_0 = log((1.0-(v_j/vdcx_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdcx_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vdcx_t*d_v_j_dX-v_j*d_vdcx_t_dX)/vdcx_t/vdcx_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
d_qjcx_dX = (((x*((cjcx0_t_i*vdcx_t)*d_y_dX+(cjcx0_t_i*d_vdcx_t_dX+d_cjcx0_t_i_dX*vdcx_t)*y)-((cjcx0_t_i*vdcx_t)*y)*d_x_dX)/x/x)+((2.4*cjcx0_t_i)*(d_Vbci_dX-d_v_j_dX)+2.4*d_cjcx0_t_i_dX*(Vbci-v_j)));
qjcx = ((((cjcx0_t_i*vdcx_t)*y)/x)+((2.4*cjcx0_t_i)*(Vbci-v_j)));
}
else
{
d_qjcx_dX = 0.0;
qjcx = 0.00;
}
}
}
if ((modelStruct.modelPar_vptci<1.0e2))
{
if ((cjci0_t_ii>0.0))
{
d_zr_dX = (modelStruct.d_modelPar_zci_dX/4.0);
zr = (modelStruct.modelPar_zci/4.0);
d_vp_dX = (modelStruct.d_modelPar_vptci_dX-d_vdci_t_dX);
vp = (modelStruct.modelPar_vptci-vdci_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zci));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdci_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)))+d_vdci_t_dX*(1.0-value_exp_1));
vf = (vdci_t*(1.0-value_exp_1));
}
d_cmax_dX = 2.4*d_cjci0_t_ii_dX;
cmax = (2.4*cjci0_t_ii);
{
double value_log_0 = log((vdci_t/modelStruct.modelPar_vptci));
double value_exp_1 = exp(((modelStruct.modelPar_zci-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vdci_t/modelStruct.modelPar_vptci));
double  deriv_exp_1_d0 = value_exp_1;
d_cr_dX = (cjci0_t_ii*deriv_exp_1_d0*(((modelStruct.modelPar_zci-zr)*deriv_log_0_d0*(((modelStruct.modelPar_vptci*d_vdci_t_dX-vdci_t*modelStruct.d_modelPar_vptci_dX)/modelStruct.modelPar_vptci/modelStruct.modelPar_vptci))+(modelStruct.d_modelPar_zci_dX-d_zr_dX)*value_log_0))+d_cjci0_t_ii_dX*value_exp_1);
cr = (cjci0_t_ii*value_exp_1);
}
d_a_dX = d_VT_dX;
a = VT;
d_ve_dX = ((a*(d_vf_dX-d_Vbici_dX)-(vf-Vbici)*d_a_dX)/a/a);
ve = ((vf-Vbici)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_ve_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj1_dX = (d_vf_dX-(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{
d_vj1_dX = d_Vbici_dX;
vj1 = Vbici;
}
d_a_dX = (0.1*d_vp_dX+4.0*d_VT_dX);
a = ((0.1*vp)+(4.0*VT));
d_vr_dX = ((a*(d_vp_dX+d_vj1_dX)-(vp+vj1)*d_a_dX)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_vr_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj2_dX = ((-d_vp_dX)+(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{
d_vj2_dX = d_vj1_dX;
vj2 = vj1;
}
d_vj4_dX = (d_Vbici_dX-d_vj1_dX);
vj4 = (Vbici-vj1);
d_ez_dX = (-modelStruct.d_modelPar_zci_dX);
ez = (1.0-modelStruct.modelPar_zci);
d_ezr_dX = (-d_zr_dX);
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vdci_t)));
d_vdj1_dX = deriv_log_0_d0*((-((vdci_t*d_vj1_dX-vj1*d_vdci_t_dX)/vdci_t/vdci_t)));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vdci_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vdci_t)));
d_vdj2_dX = deriv_log_0_d0*((-((vdci_t*d_vj2_dX-vj2*d_vdci_t_dX)/vdci_t/vdci_t)));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;
d_qj1_dX = ((ez*(cjci0_t_ii*(-deriv_exp_0_d0*((vdj2*d_ez_dX+d_vdj2_dX*ez)))+d_cjci0_t_ii_dX*(1.0-value_exp_0))-(cjci0_t_ii*(1.0-value_exp_0))*d_ez_dX)/ez/ez);
qj1 = ((cjci0_t_ii*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj2_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj1*d_ezr_dX+d_vdj1_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj3_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj2*d_ezr_dX+d_vdj2_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}
instanceStruct.d_instanceVar_qjci_dX = ((((qj1+qj2)-qj3)*d_vdci_t_dX+((d_qj1_dX+d_qj2_dX)-d_qj3_dX)*vdci_t)+(cmax*d_vj4_dX+d_cmax_dX*vj4));
instanceStruct.instanceVar_qjci = ((((qj1+qj2)-qj3)*vdci_t)+(cmax*vj4));
}
else
{
instanceStruct.d_instanceVar_qjci_dX = 0.0;
instanceStruct.instanceVar_qjci = 0.0;
}
}
else
{
if ((cjci0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zci));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdci_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)))+d_vdci_t_dX*(1.0-value_exp_1));
vf = (vdci_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbici_dX)-(vf-Vbici)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zci_dX);
x = (1.0-modelStruct.modelPar_zci);
{
double value_log_0 = log((1.0-(v_j/vdci_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vdci_t*d_v_j_dX-v_j*d_vdci_t_dX)/vdci_t/vdci_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
instanceStruct.d_instanceVar_qjci_dX = (((x*((cjci0_t_ii*vdci_t)*d_y_dX+(cjci0_t_ii*d_vdci_t_dX+d_cjci0_t_ii_dX*vdci_t)*y)-((cjci0_t_ii*vdci_t)*y)*d_x_dX)/x/x)+((2.4*cjci0_t_ii)*(d_Vbici_dX-d_v_j_dX)+2.4*d_cjci0_t_ii_dX*(Vbici-v_j)));
instanceStruct.instanceVar_qjci = ((((cjci0_t_ii*vdci_t)*y)/x)+((2.4*cjci0_t_ii)*(Vbici-v_j)));
}
else
{
instanceStruct.d_instanceVar_qjci_dX = 0.0;
instanceStruct.instanceVar_qjci = 0.00;
}
}
d_qjci_int_dX = instanceStruct.d_instanceVar_qjci_dX;
qjci_int = instanceStruct.instanceVar_qjci;
d_qjcii_dX = (instanceStruct.d_instanceVar_qjci_dX+d_qjcxi_dX);
qjcii = (instanceStruct.instanceVar_qjci+qjcxi);
if ((cjci0_t_ii>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zci));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdci_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)))+d_vdci_t_dX*(1.0-value_exp_1));
vf = (vdci_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbici_dX)-(vf-Vbici)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbici)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_dvj_dX = ((xvf2*0.5*(d_xvf_dX+d_xvf2_dX)-(0.5*(xvf+xvf2))*d_xvf2_dX)/xvf2/xvf2);
dvj = ((0.5*(xvf+xvf2))/xvf2);
{
double value_log_0 = log((1-(v_j/vdci_t)));
double value_exp_1 = exp(((-modelStruct.modelPar_zci)*value_log_0));
double  deriv_log_0_d0 = (1.0/(1-(v_j/vdci_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_cjcii_dX = (((cjci0_t_ii*value_exp_1)*d_dvj_dX+(cjci0_t_ii*deriv_exp_1_d0*(((-modelStruct.modelPar_zci)*deriv_log_0_d0*((-((vdci_t*d_v_j_dX-v_j*d_vdci_t_dX)/vdci_t/vdci_t)))+(-modelStruct.d_modelPar_zci_dX)*value_log_0))+d_cjci0_t_ii_dX*value_exp_1)*dvj)+((2.4*cjci0_t_ii)*(-d_dvj_dX)+2.4*d_cjci0_t_ii_dX*(1-dvj)));
cjcii = (((cjci0_t_ii*value_exp_1)*dvj)+((2.4*cjci0_t_ii)*(1-dvj)));
}
}
else
{
d_cjcii_dX = 0.0;
cjcii = 0.0;
}
d_vc_dX = (d_Vciei_dX-d_vces_t_dX);
vc = (Vciei-vces_t);
d_uvc_dX = ((VT*d_vc_dX-vc*d_VT_dX)/VT/VT);
uvc = ((vc/VT)-1);
{
double value_sqrt_0 = sqrt(((uvc*uvc)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_vceff_dX = (VT*0.5*(d_uvc_dX+deriv_sqrt_0_d0*((uvc*d_uvc_dX+d_uvc_dX*uvc)))+d_VT_dX*(1+(0.5*(uvc+value_sqrt_0))));
vceff = (VT*(1+(0.5*(uvc+value_sqrt_0))));
}
d_x_dX = ((modelStruct.modelPar_vpt*(d_vceff_dX-d_vlim_t_dX)-(vceff-vlim_t)*modelStruct.d_modelPar_vpt_dX)/modelStruct.modelPar_vpt/modelStruct.modelPar_vpt);
x = ((vceff-vlim_t)/modelStruct.modelPar_vpt);
{
double value_sqrt_0 = sqrt(((x*x)+1e-3));
double value_sqrt_1 = sqrt((1+(((vceff*vceff)/vlim_t)/vlim_t)));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
d_ick_dX = ((value_sqrt_1*((rci0_t*(vceff*0.5*(d_x_dX+deriv_sqrt_0_d0*((x*d_x_dX+d_x_dX*x)))+d_vceff_dX*(1+(0.5*(x+value_sqrt_0))))-(vceff*(1+(0.5*(x+value_sqrt_0))))*d_rci0_t_dX)/rci0_t/rci0_t)-((vceff*(1+(0.5*(x+value_sqrt_0))))/rci0_t)*deriv_sqrt_1_d0*(((vlim_t*((vlim_t*(vceff*d_vceff_dX+d_vceff_dX*vceff)-(vceff*vceff)*d_vlim_t_dX)/vlim_t/vlim_t)-((vceff*vceff)/vlim_t)*d_vlim_t_dX)/vlim_t/vlim_t)))/value_sqrt_1/value_sqrt_1);
ick = (((vceff*(1+(0.5*(x+value_sqrt_0))))/rci0_t)/value_sqrt_1);
}
if (((cjcii>0.0)&&(cjci0_t_ii>0.0)))
{
d_cc_dX = ((cjcii*d_cjci0_t_ii_dX-cjci0_t_ii*d_cjcii_dX)/cjcii/cjcii);
cc = (cjci0_t_ii/cjcii);
instanceStruct.d_instanceVar_qjci_dX = ((cjci0_t_ii*instanceStruct.d_instanceVar_qjci_dX-instanceStruct.instanceVar_qjci*d_cjci0_t_ii_dX)/cjci0_t_ii/cjci0_t_ii);
instanceStruct.instanceVar_qjci = (instanceStruct.instanceVar_qjci/cjci0_t_ii);
}
else
{
d_cc_dX = 0.0;
cc = 1.0;
instanceStruct.d_instanceVar_qjci_dX = 0.0;
instanceStruct.instanceVar_qjci = 0;
}
if ((cje0_dc_t>0.0))
{
{
double value_log_0 = log(ajedc_t);
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zedc));
double  deriv_log_0_d0 = (1.0/ajedc_t);
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vdedc_t*(-deriv_exp_1_d0*(((modelStruct.modelPar_zedc*(-deriv_log_0_d0*(d_ajedc_t_dX))-(-value_log_0)*modelStruct.d_modelPar_zedc_dX)/modelStruct.modelPar_zedc/modelStruct.modelPar_zedc)))+d_vdedc_t_dX*(1.0-value_exp_1));
vf = (vdedc_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbiei_dX)-(vf-Vbiei)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbiei)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zedc_dX);
x = (1.0-modelStruct.modelPar_zedc);
{
double value_log_0 = log((1.0-(v_j/vdedc_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vdedc_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vdedc_t*d_v_j_dX-v_j*d_vdedc_t_dX)/vdedc_t/vdedc_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
instanceStruct.d_instanceVar_qjei_dX = (((x*((cje0_dc_t*vdedc_t)*d_y_dX+(cje0_dc_t*d_vdedc_t_dX+d_cje0_dc_t_dX*vdedc_t)*y)-((cje0_dc_t*vdedc_t)*y)*d_x_dX)/x/x)+((ajedc_t*cje0_dc_t)*(d_Vbiei_dX-d_v_j_dX)+(ajedc_t*d_cje0_dc_t_dX+d_ajedc_t_dX*cje0_dc_t)*(Vbiei-v_j)));
instanceStruct.instanceVar_qjei = ((((cje0_dc_t*vdedc_t)*y)/x)+((ajedc_t*cje0_dc_t)*(Vbiei-v_j)));
}
else
{
instanceStruct.d_instanceVar_qjei_dX = 0.0;
instanceStruct.instanceVar_qjei = 0.00;
}
if ((modelStruct.modelPar_aver==0.0))
{
d_h_vbe_dX = 0.0;
h_vbe = 1;
}
else
{
d_vjh_dX = (((2.0*VT)*(d_vdedc_t_dX-d_Vbiei_dX)-(vdedc_t-Vbiei)*2.0*d_VT_dX)/(2.0*VT)/(2.0*VT));
vjh = ((vdedc_t-Vbiei)/(2.0*VT));
{
double value_sqrt_0 = sqrt(((vjh*vjh)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_vjh_dX = (d_vdedc_t_dX-((2.0*VT)*(d_vjh_dX+deriv_sqrt_0_d0*((vjh*d_vjh_dX+d_vjh_dX*vjh)))+2.0*d_VT_dX*(vjh+value_sqrt_0))*0.5);
vjh = (vdedc_t-(((2.0*VT)*(vjh+value_sqrt_0))*0.5));
}
d_vjh_dX = ((VT*(d_vjh_dX-d_VT_dX)-(vjh-VT)*d_VT_dX)/VT/VT);
vjh = ((vjh-VT)/VT);
{
double value_sqrt_0 = sqrt(((vjh*vjh)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_vjh_dX = (VT*(d_vjh_dX+deriv_sqrt_0_d0*((vjh*d_vjh_dX+d_vjh_dX*vjh)))*0.5+d_VT_dX*(1.0+((vjh+value_sqrt_0)*0.5)));
vjh = (VT*(1.0+((vjh+value_sqrt_0)*0.5)));
}
{
double value_log_0 = log((1.0-(vjh/vdedc_t)));
double value_exp_1 = exp((modelStruct.modelPar_zedc*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(vjh/vdedc_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_vj_z_dX = ((1.0-value_exp_1)*d_aver_t_dX+(-deriv_exp_1_d0*((modelStruct.modelPar_zedc*deriv_log_0_d0*((-((vdedc_t*d_vjh_dX-vjh*d_vdedc_t_dX)/vdedc_t/vdedc_t)))+modelStruct.d_modelPar_zedc_dX*value_log_0)))*aver_t);
vj_z = ((1.0-value_exp_1)*aver_t);
}
{
double value_exp_0 = exp(vj_z);
double  deriv_exp_0_d0 = value_exp_0;
d_h_vbe_dX = ((vj_z*deriv_exp_0_d0*(d_vj_z_dX)-(value_exp_0-1.0)*d_vj_z_dX)/vj_z/vj_z);
h_vbe = ((value_exp_0-1.0)/vj_z);
}
}
d_qje_dX = ((cje0_dc_t*(h_vbe*instanceStruct.d_instanceVar_qjei_dX+d_h_vbe_dX*instanceStruct.instanceVar_qjei)-(h_vbe*instanceStruct.instanceVar_qjei)*d_cje0_dc_t_dX)/cje0_dc_t/cje0_dc_t);
qje = ((h_vbe*instanceStruct.instanceVar_qjei)/cje0_dc_t);
d_qj_dX = (((modelStruct.modelPar_vef*instanceStruct.d_instanceVar_qjci_dX-instanceStruct.instanceVar_qjci*modelStruct.d_modelPar_vef_dX)/modelStruct.modelPar_vef/modelStruct.modelPar_vef)+((ver_t*d_qje_dX-qje*d_ver_t_dX)/ver_t/ver_t));
qj = ((1+(instanceStruct.instanceVar_qjci/modelStruct.modelPar_vef))+(qje/ver_t));
d_b_q_dX = 20*d_qj_dX;
b_q = ((20*qj)-1);
{
double value_sqrt_0 = sqrt(((b_q*b_q)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_qj_2_dX = 0.025*((d_b_q_dX+deriv_sqrt_0_d0*((b_q*d_b_q_dX+d_b_q_dX*b_q)))/2);
qj_2 = (0.025*(1+((b_q+value_sqrt_0)/2)));
}
d_tf0_dX = ((d_t0_t_dX+(modelStruct.modelPar_dt0h*d_cc_dX+modelStruct.d_modelPar_dt0h_dX*(cc-1)))+(modelStruct.modelPar_tbvl*(-1*d_cc_dX/cc/cc)+modelStruct.d_modelPar_tbvl_dX*((1/cc)-1)));
tf0 = ((t0_t+(modelStruct.modelPar_dt0h*(cc-1)))+(modelStruct.modelPar_tbvl*((1/cc)-1)));
if ((modelStruct.modelPar_fiqf==1))
{
d_denom_iqf_dX = (modelStruct.modelPar_fiqf*((t0_t*d_tf0_dX-tf0*d_t0_t_dX)/t0_t/t0_t)+modelStruct.d_modelPar_fiqf_dX*((tf0/t0_t)-1));
denom_iqf = (modelStruct.modelPar_fiqf*((tf0/t0_t)-1));
d_ickf_dX = (((1+denom_iqf)*d_iqf_t_dX-iqf_t*d_denom_iqf_dX)/(1+denom_iqf)/(1+denom_iqf));
ickf = (iqf_t/(1+denom_iqf));
}
else
{
d_ickf_dX = d_iqf_t_dX;
ickf = iqf_t;
}
d_ickr_dX = modelStruct.d_modelPar_iqr_dX;
ickr = modelStruct.modelPar_iqr;
d_arg1_dX = (((modelStruct.modelPar_mcf*VT)*d_Vbiei_dX-Vbiei*(modelStruct.modelPar_mcf*d_VT_dX+modelStruct.d_modelPar_mcf_dX*VT))/(modelStruct.modelPar_mcf*VT)/(modelStruct.modelPar_mcf*VT));
arg1 = (Vbiei/(modelStruct.modelPar_mcf*VT));
if ((arg1>80))
{
d_le1_dX = d_arg1_dX;
le1 = (1+(arg1-80));
d_arg1_dX = 0.0;
arg1 = 80;
}
else
{
d_le1_dX = 0.0;
le1 = 1;
}
{
double value_limexp_0 = limexp(arg1);
double  deriv_limexp_0_d0 = (((arg1)<80)?(value_limexp_0):exp(80.0));
d_le1_dX = (le1*deriv_limexp_0_d0*(d_arg1_dX)+d_le1_dX*value_limexp_0);
le1 = (le1*value_limexp_0);
}
d_itfi_dX = (is_t*d_le1_dX+d_is_t_dX*le1);
itfi = (is_t*le1);
d_arg2_dX = (((modelStruct.modelPar_mcr*VT)*d_Vbici_dX-Vbici*(modelStruct.modelPar_mcr*d_VT_dX+modelStruct.d_modelPar_mcr_dX*VT))/(modelStruct.modelPar_mcr*VT)/(modelStruct.modelPar_mcr*VT));
arg2 = (Vbici/(modelStruct.modelPar_mcr*VT));
if ((arg2>80))
{
d_le2_dX = d_arg2_dX;
le2 = (1+(arg2-80));
d_arg2_dX = 0.0;
arg2 = 80;
}
else
{
d_le2_dX = 0.0;
le2 = 1;
}
{
double value_limexp_0 = limexp(arg2);
double  deriv_limexp_0_d0 = (((arg2)<80)?(value_limexp_0):exp(80.0));
d_le2_dX = (le2*deriv_limexp_0_d0*(d_arg2_dX)+d_le2_dX*value_limexp_0);
le2 = (le2*value_limexp_0);
}
d_itri_dX = (is_t*d_le2_dX+d_is_t_dX*le2);
itri = (is_t*le2);
if ((modelStruct.modelPar_tfh!=0))
{
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_qml_dX = ((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+deriv_exp_1_d0*(0.6666*deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dX-tfh_t*d_iqfh_t_dX)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dX-itfi*d_ick_dX)/ick/ick)+d_itfi_dX*(itfi/ick))*(tfh_t/iqfh_t)))));
qml = (((itfi/ickf)+(itri/ickr))+value_exp_1);
}
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_qmh_dX = (((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+((iqfh_t*d_itfi_dX-itfi*d_iqfh_t_dX)/iqfh_t/iqfh_t))+deriv_exp_1_d0*(0.6666*deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dX-tfh_t*d_iqfh_t_dX)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dX-itfi*d_ick_dX)/ick/ick)+d_itfi_dX*(itfi/ick))*(tfh_t/iqfh_t)))));
qmh = ((((itfi/ickf)+(itri/ickr))+(itfi/iqfh_t))+value_exp_1);
}
}
else
{
d_qml_dX = (((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr));
qml = ((itfi/ickf)+(itri/ickr));
d_qmh_dX = ((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+((iqfh_t*d_itfi_dX-itfi*d_iqfh_t_dX)/iqfh_t/iqfh_t));
qmh = (((itfi/ickf)+(itri/ickr))+(itfi/iqfh_t));
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qml));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_qpt_l_dX = (d_qj_2_dX+deriv_sqrt_0_d0*(((qj_2*d_qj_2_dX+d_qj_2_dX*qj_2)+d_qml_dX)));
qpt_l = (qj_2+value_sqrt_0);
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qmh));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_qpt_h_dX = (d_qj_2_dX+deriv_sqrt_0_d0*(((qj_2*d_qj_2_dX+d_qj_2_dX*qj_2)+d_qmh_dX)));
qpt_h = (qj_2+value_sqrt_0);
}
d_diff_q_dX = (d_qmh_dX-d_qml_dX);
diff_q = (qmh-qml);
if ((fabs(diff_q)>1e-8))
{
d_a1_dX = (-(((ick/(1+ahq_t))/itfi)*d_qpt_l_dX+((itfi*(((1+ahq_t)*d_ick_dX-ick*d_ahq_t_dX)/(1+ahq_t)/(1+ahq_t))-(ick/(1+ahq_t))*d_itfi_dX)/itfi/itfi)*qpt_l));
a1 = (1-(((ick/(1+ahq_t))/itfi)*qpt_l));
d_a2_dX = (((ick/(1+ahq_t))/itfi)*(d_qpt_h_dX-d_qpt_l_dX)+((itfi*(((1+ahq_t)*d_ick_dX-ick*d_ahq_t_dX)/(1+ahq_t)/(1+ahq_t))-(ick/(1+ahq_t))*d_itfi_dX)/itfi/itfi)*(qpt_h-qpt_l));
a2 = (1+(((ick/(1+ahq_t))/itfi)*(qpt_h-qpt_l)));
d_aa_dX = ((a2*d_a1_dX-a1*d_a2_dX)/a2/a2);
aa = (a1/a2);
{
double value_sqrt_0 = sqrt(((aa*aa)+0.01));
double value_sqrt_1 = sqrt((1+0.01));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_wdc_dX = ((deriv_sqrt_0_d0*((aa*d_aa_dX+d_aa_dX*aa))+d_aa_dX)/(1+value_sqrt_1));
wdc = ((value_sqrt_0+aa)/(1+value_sqrt_1));
}
}
else
{
d_wdc_dX = 0.0;
wdc = 0;
}
if ((modelStruct.modelPar_it_mod==0))
{
if ((modelStruct.modelPar_tfh!=0))
{
{
double value_log_0 = log(((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double value_exp_1 = exp((0.6666*value_log_0));
double  deriv_log_0_d0 = (1.0/((itfi*(itfi/ick))*(tfh_t/iqfh_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_qm_dX = (((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dX+((itfi/iqfh_t)*d_wdc_dX+((iqfh_t*d_itfi_dX-itfi*d_iqfh_t_dX)/iqfh_t/iqfh_t)*wdc)*wdc))+deriv_exp_1_d0*(0.6666*deriv_log_0_d0*(((itfi*(itfi/ick))*((iqfh_t*d_tfh_t_dX-tfh_t*d_iqfh_t_dX)/iqfh_t/iqfh_t)+(itfi*((ick*d_itfi_dX-itfi*d_ick_dX)/ick/ick)+d_itfi_dX*(itfi/ick))*(tfh_t/iqfh_t)))));
qm = ((((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc))+value_exp_1);
}
}
else
{
d_qm_dX = ((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dX+((itfi/iqfh_t)*d_wdc_dX+((iqfh_t*d_itfi_dX-itfi*d_iqfh_t_dX)/iqfh_t/iqfh_t)*wdc)*wdc));
qm = (((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc));
}
{
double value_sqrt_0 = sqrt(((qj_2*qj_2)+qm));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_qpt_dX = (d_qj_2_dX+deriv_sqrt_0_d0*(((qj_2*d_qj_2_dX+d_qj_2_dX*qj_2)+d_qm_dX)));
qpt = (qj_2+value_sqrt_0);
}
}
else
{
o3 = (1.0/3);
d_p2_a_dX = (-2)*d_qj_2_dX;
p2_a = ((-2)*qj_2);
if (((modelStruct.modelPar_iqf==1.0e6)&&(modelStruct.modelPar_iqfh==1.0e6)))
{
d_p2_b_dX = 0.0;
p2_b = 0;
}
else
{
d_p2_b_dX = (-((((ickf*d_itfi_dX-itfi*d_ickf_dX)/ickf/ickf)+((ickr*d_itri_dX-itri*d_ickr_dX)/ickr/ickr))+(((itfi/iqfh_t)*wdc)*d_wdc_dX+((itfi/iqfh_t)*d_wdc_dX+((iqfh_t*d_itfi_dX-itfi*d_iqfh_t_dX)/iqfh_t/iqfh_t)*wdc)*wdc)));
p2_b = (-(((itfi/ickf)+(itri/ickr))+(((itfi/iqfh_t)*wdc)*wdc)));
}
d_p2_c_dX = ((iqfh_t*((((-itfi)*itfi)/ick)*d_tfh_t_dX+((ick*((-itfi)*d_itfi_dX+(-d_itfi_dX)*itfi)-((-itfi)*itfi)*d_ick_dX)/ick/ick)*tfh_t)-((((-itfi)*itfi)/ick)*tfh_t)*d_iqfh_t_dX)/iqfh_t/iqfh_t);
p2_c = (((((-itfi)*itfi)/ick)*tfh_t)/iqfh_t);
d_tmp_dX = (p2_a*d_p2_a_dX+d_p2_a_dX*p2_a);
tmp = (p2_a*p2_a);
d_p2_p_dX = (d_p2_b_dX-d_tmp_dX*o3);
p2_p = (p2_b-(tmp*o3));
d_p2_q_dX = (((((2*p2_a)*d_tmp_dX+2*d_p2_a_dX*tmp)/27)-(p2_a*d_p2_b_dX+d_p2_a_dX*p2_b)*o3)+d_p2_c_dX);
p2_q = (((((2*p2_a)*tmp)/27)-((p2_a*p2_b)*o3))+p2_c);
d_p2_D_dX = ((p2_q*d_p2_q_dX+d_p2_q_dX*p2_q)*0.25+(((p2_p*p2_p)*d_p2_p_dX+(p2_p*d_p2_p_dX+d_p2_p_dX*p2_p)*p2_p)/27));
p2_D = (((p2_q*p2_q)*0.25)+(((p2_p*p2_p)*p2_p)/27));
if ((fabs(p2_D)<1e-10))
{
d_q_p3_dX = (((p2_p*3*d_p2_q_dX-(3*p2_q)*d_p2_p_dX)/p2_p/p2_p)-d_p2_a_dX*o3);
q_p3 = (((3*p2_q)/p2_p)-(p2_a*o3));
}
else
{
if ((p2_D>0))
{
d_tmp2_dX = (-d_p2_q_dX)*0.5;
tmp2 = ((-p2_q)*0.5);
{
double value_sqrt_0 = sqrt(p2_D);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_tmp3_dX = deriv_sqrt_0_d0*(d_p2_D_dX);
tmp3 = value_sqrt_0;
}
d_tmp_dX = (d_tmp2_dX+d_tmp3_dX);
tmp = (tmp2+tmp3);
if ((tmp>0))
{
{
double value_log_0 = log(tmp);
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/tmp);
double  deriv_exp_1_d0 = value_exp_1;
d_p2_u_dX = deriv_exp_1_d0*(o3*deriv_log_0_d0*(d_tmp_dX));
p2_u = value_exp_1;
}
}
else
{
{
double value_log_0 = log((-tmp));
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/(-tmp));
double  deriv_exp_1_d0 = value_exp_1;
d_p2_u_dX = (-deriv_exp_1_d0*(o3*deriv_log_0_d0*((-d_tmp_dX))));
p2_u = (-value_exp_1);
}
}
d_tmp_dX = (d_tmp2_dX-d_tmp3_dX);
tmp = (tmp2-tmp3);
if ((tmp>0))
{
{
double value_log_0 = log(tmp);
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/tmp);
double  deriv_exp_1_d0 = value_exp_1;
d_p2_v_dX = deriv_exp_1_d0*(o3*deriv_log_0_d0*(d_tmp_dX));
p2_v = value_exp_1;
}
}
else
{
{
double value_log_0 = log((-tmp));
double value_exp_1 = exp((o3*value_log_0));
double  deriv_log_0_d0 = (1.0/(-tmp));
double  deriv_exp_1_d0 = value_exp_1;
d_p2_v_dX = (-deriv_exp_1_d0*(o3*deriv_log_0_d0*((-d_tmp_dX))));
p2_v = (-value_exp_1);
}
}
d_q_p3_dX = ((d_p2_u_dX+d_p2_v_dX)-d_p2_a_dX*o3);
q_p3 = ((p2_u+p2_v)-(p2_a*o3));
}
else
{
{
double value_sqrt_0 = sqrt(((-27.0)/((p2_p*p2_p)*p2_p)));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_tmp_dX = (((-p2_q)*0.5)*deriv_sqrt_0_d0*((-(-27.0)*((p2_p*p2_p)*d_p2_p_dX+(p2_p*d_p2_p_dX+d_p2_p_dX*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)/((p2_p*p2_p)*p2_p)))+(-d_p2_q_dX)*0.5*value_sqrt_0);
tmp = (((-p2_q)*0.5)*value_sqrt_0);
}
d_tmp2_dX = (tmp*d_tmp_dX+d_tmp_dX*tmp);
tmp2 = (tmp*tmp);
if ((tmp>=0))
{
{
double value_sqrt_0 = sqrt((tmp2/(1-tmp2)));
double value_atan_1 = atan(value_sqrt_0);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_atan_1_d0 = (+1.0/(1+value_sqrt_0*value_sqrt_0));
d_tmp_dX = (-deriv_atan_1_d0*(deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dX-tmp2*(-d_tmp2_dX))/(1-tmp2)/(1-tmp2)))));
tmp = ((3.14159265358979323846/2)-value_atan_1);
}
}
else
{
{
double value_sqrt_0 = sqrt((tmp2/(1-tmp2)));
double value_atan_1 = atan(value_sqrt_0);
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_atan_1_d0 = (+1.0/(1+value_sqrt_0*value_sqrt_0));
d_tmp_dX = deriv_atan_1_d0*(deriv_sqrt_0_d0*((((1-tmp2)*d_tmp2_dX-tmp2*(-d_tmp2_dX))/(1-tmp2)/(1-tmp2))));
tmp = ((3.14159265358979323846/2)+value_atan_1);
}
}
{
double value_sqrt_0 = sqrt((((-4)*p2_p)*o3));
double value_cos_1 = cos((o3*tmp));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
double  deriv_cos_1_d0 = (-sin((o3*tmp)));
d_tmp_dX = ((value_sqrt_0*deriv_cos_1_d0*(o3*d_tmp_dX)+deriv_sqrt_0_d0*((-4)*d_p2_p_dX*o3)*value_cos_1)-d_p2_a_dX*o3);
tmp = ((value_sqrt_0*value_cos_1)-(p2_a*o3));
}
d_q_p3_dX = d_tmp_dX;
q_p3 = tmp;
}
}
d_qpt_dX = d_q_p3_dX;
qpt = q_p3;
}
if ((qpt<=1e-20))
{
d_qpt_dX = 0.0;
qpt = 1e-20;
}
d_itf_dX = ((qpt*d_itfi_dX-itfi*d_qpt_dX)/qpt/qpt);
itf = (itfi/qpt);
d_itr_dX = ((qpt*d_itri_dX-itri*d_qpt_dX)/qpt/qpt);
itr = (itri/qpt);
if ((itf<=1e-20))
{
d_itf_dX = 0.0;
itf = 1e-20;
}
instanceStruct.d_instanceVar_it_dX = (d_itf_dX-d_itr_dX);
instanceStruct.instanceVar_it = (itf-itr);
d_qf0_dX = (tf0*d_itf_dX+d_tf0_dX*itf);
qf0 = (tf0*itf);
d_a_dX = (-((itf*d_ick_dX-ick*d_itf_dX)/itf/itf));
a = (1-(ick/itf));
{
double value_sqrt_0 = sqrt(((a*a)+modelStruct.modelPar_ahc));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_s3_dX = deriv_sqrt_0_d0*(((a*d_a_dX+d_a_dX*a)+modelStruct.d_modelPar_ahc_dX));
s3 = value_sqrt_0;
}
{
double value_sqrt_0 = sqrt((1+modelStruct.modelPar_ahc));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_w_dX = (((1+value_sqrt_0)*(d_a_dX+d_s3_dX)-(a+s3)*deriv_sqrt_0_d0*(modelStruct.d_modelPar_ahc_dX))/(1+value_sqrt_0)/(1+value_sqrt_0));
w = ((a+s3)/(1+value_sqrt_0));
}
d_tww_dX = ((thcs_t*w)*d_w_dX+(thcs_t*d_w_dX+d_thcs_t_dX*w)*w);
tww = ((thcs_t*w)*w);
d_dqfh_dX = (tww*d_itf_dX+d_tww_dX*itf);
dqfh = (tww*itf);
d_dtfh_dX = (tww*((s3*((itf*2*d_ick_dX-(2*ick)*d_itf_dX)/itf/itf)-((2*ick)/itf)*d_s3_dX)/s3/s3)+d_tww_dX*(1+(((2*ick)/itf)/s3)));
dtfh = (tww*(1+(((2*ick)/itf)/s3)));
{
double value_log_0 = log((itf/ick));
double value_exp_1 = exp((modelStruct.modelPar_gte*value_log_0));
double  deriv_log_0_d0 = (1.0/(itf/ick));
double  deriv_exp_1_d0 = value_exp_1;
d_dtef_dX = (tef0_t*deriv_exp_1_d0*((modelStruct.modelPar_gte*deriv_log_0_d0*(((ick*d_itf_dX-itf*d_ick_dX)/ick/ick))+modelStruct.d_modelPar_gte_dX*value_log_0))+d_tef0_t_dX*value_exp_1);
dtef = (tef0_t*value_exp_1);
}
d_dqef_dX = (((modelStruct.modelPar_gte+1.0)*(dtef*d_itf_dX+d_dtef_dX*itf)-(dtef*itf)*modelStruct.d_modelPar_gte_dX)/(modelStruct.modelPar_gte+1.0)/(modelStruct.modelPar_gte+1.0));
dqef = ((dtef*itf)/(modelStruct.modelPar_gte+1.0));
d_qf_dX = ((d_qf0_dX+d_dqef_dX)+d_dqfh_dX);
qf = ((qf0+dqef)+dqfh);
d_tf_dX = ((d_tf0_dX+d_dtfh_dX)+d_dtef_dX);
tf = ((tf0+dtfh)+dtef);
d_qr_dX = (modelStruct.modelPar_tr*d_itr_dX+modelStruct.d_modelPar_tr_dX*itr);
qr = (modelStruct.modelPar_tr*itr);
d_DIOY_dX = (((modelStruct.modelPar_mbe*VT)*d_Vbiei_dX-Vbiei*(modelStruct.modelPar_mbe*d_VT_dX+modelStruct.d_modelPar_mbe_dX*VT))/(modelStruct.modelPar_mbe*VT)/(modelStruct.modelPar_mbe*VT));
DIOY = (Vbiei/(modelStruct.modelPar_mbe*VT));
if ((modelStruct.modelPar_ibes>0.0))
{
if ((DIOY>80))
{
d_le_dX = d_DIOY_dX;
le = (1+(DIOY-80));
d_DIOY_dX = 0.0;
DIOY = 80;
}
else
{
d_le_dX = 0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));
d_le_dX = (le*deriv_limexp_0_d0*(d_DIOY_dX)+d_le_dX*value_limexp_0);
le = (le*value_limexp_0);
}
d_ibe_dX = (ibes_t*d_le_dX+d_ibes_t_dX*(le-1.0));
ibe = (ibes_t*(le-1.0));
if ((DIOY<=(-14.0)))
{
d_ibe_dX = (-d_ibes_t_dX);
ibe = (-ibes_t);
}
}
else
{
d_ibe_dX = 0.0;
ibe = 0.0;
}
d_DIOY_dX = (((modelStruct.modelPar_mre*VT)*d_Vbiei_dX-Vbiei*(modelStruct.modelPar_mre*d_VT_dX+modelStruct.d_modelPar_mre_dX*VT))/(modelStruct.modelPar_mre*VT)/(modelStruct.modelPar_mre*VT));
DIOY = (Vbiei/(modelStruct.modelPar_mre*VT));
if ((modelStruct.modelPar_ires>0.0))
{
if ((DIOY>80))
{
d_le_dX = d_DIOY_dX;
le = (1+(DIOY-80));
d_DIOY_dX = 0.0;
DIOY = 80;
}
else
{
d_le_dX = 0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));
d_le_dX = (le*deriv_limexp_0_d0*(d_DIOY_dX)+d_le_dX*value_limexp_0);
le = (le*value_limexp_0);
}
d_ire_dX = (ires_t*d_le_dX+d_ires_t_dX*(le-1.0));
ire = (ires_t*(le-1.0));
if ((DIOY<=(-14.0)))
{
d_ire_dX = (-d_ires_t_dX);
ire = (-ires_t);
}
}
else
{
d_ire_dX = 0.0;
ire = 0.0;
}
instanceStruct.d_instanceVar_ijbe_dX = (d_ibe_dX+d_ire_dX);
instanceStruct.instanceVar_ijbe = (ibe+ire);
d_DIOY_dX = (((modelStruct.modelPar_mbc*VT)*d_Vbici_dX-Vbici*(modelStruct.modelPar_mbc*d_VT_dX+modelStruct.d_modelPar_mbc_dX*VT))/(modelStruct.modelPar_mbc*VT)/(modelStruct.modelPar_mbc*VT));
DIOY = (Vbici/(modelStruct.modelPar_mbc*VT));
if ((modelStruct.modelPar_ibcs>0.0))
{
if ((DIOY>80))
{
d_le_dX = d_DIOY_dX;
le = (1+(DIOY-80));
d_DIOY_dX = 0.0;
DIOY = 80;
}
else
{
d_le_dX = 0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));
d_le_dX = (le*deriv_limexp_0_d0*(d_DIOY_dX)+d_le_dX*value_limexp_0);
le = (le*value_limexp_0);
}
instanceStruct.d_instanceVar_ijbc_dX = (ibcs_t*d_le_dX+d_ibcs_t_dX*(le-1.0));
instanceStruct.instanceVar_ijbc = (ibcs_t*(le-1.0));
if ((DIOY<=(-14.0)))
{
instanceStruct.d_instanceVar_ijbc_dX = (-d_ibcs_t_dX);
instanceStruct.instanceVar_ijbc = (-ibcs_t);
}
}
else
{
instanceStruct.d_instanceVar_ijbc_dX = 0.0;
instanceStruct.instanceVar_ijbc = 0.0;
}
d_ibi_dX = (instanceStruct.d_instanceVar_ijbe_dX+instanceStruct.d_instanceVar_ijbc_dX);
ibi = (instanceStruct.instanceVar_ijbe+instanceStruct.instanceVar_ijbc);
if ((Vbici<0))
//Begin block HICAVL
{
d_v_bord_dX = (eavl_t*d_vdci_t_dX+d_eavl_t_dX*vdci_t);
v_bord = (eavl_t*vdci_t);
if (((vdci_t-Vbici)>v_bord))
{
{
double value_exp_0 = exp((-cc));
double  deriv_exp_0_d0 = value_exp_0;
d_a_iavl_dX = ((kavl_t/vdci_t)*deriv_exp_0_d0*((-d_cc_dX))+((vdci_t*d_kavl_t_dX-kavl_t*d_vdci_t_dX)/vdci_t/vdci_t)*value_exp_0);
a_iavl = ((kavl_t/vdci_t)*value_exp_0);
}
instanceStruct.d_instanceVar_iavl_dX = ((itf*a_iavl)*(d_v_bord_dX+((1+cc)*((d_vdci_t_dX-d_Vbici_dX)-d_v_bord_dX)+d_cc_dX*((vdci_t-Vbici)-v_bord)))+(itf*d_a_iavl_dX+d_itf_dX*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
instanceStruct.instanceVar_iavl = ((itf*a_iavl)*(v_bord+((1+cc)*((vdci_t-Vbici)-v_bord))));
}
else
{
{
double value_log_0 = log((1/cc));
double  deriv_log_0_d0 = (1.0/(1/cc));
d_lncc_dX = deriv_log_0_d0*((-1*d_cc_dX/cc/cc));
lncc = value_log_0;
}
{
double value_exp_0 = exp((((1/modelStruct.modelPar_zci)-1)*lncc));
double value_exp_1 = exp(((((-1)/modelStruct.modelPar_zci)*lncc)-(eavl_t*value_exp_0)));
double  deriv_exp_0_d0 = value_exp_0;
double  deriv_exp_1_d0 = value_exp_1;
instanceStruct.d_instanceVar_iavl_dX = ((kavl_t*itf)*deriv_exp_1_d0*(((((-1)/modelStruct.modelPar_zci)*d_lncc_dX+(-(-1)*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)*lncc)-(eavl_t*deriv_exp_0_d0*((((1/modelStruct.modelPar_zci)-1)*d_lncc_dX+(-1*modelStruct.d_modelPar_zci_dX/modelStruct.modelPar_zci/modelStruct.modelPar_zci)*lncc))+d_eavl_t_dX*value_exp_0)))+(kavl_t*d_itf_dX+d_kavl_t_dX*itf)*value_exp_1);
instanceStruct.instanceVar_iavl = ((kavl_t*itf)*value_exp_1);
}
}
}
// End block HICAVL
else
{
instanceStruct.d_instanceVar_iavl_dX = 0.0;
instanceStruct.instanceVar_iavl = 0;
}
if ((cje0_t>0.0))
{
{
double value_log_0 = log(aje_t);
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_ze));
double  deriv_log_0_d0 = (1.0/aje_t);
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vde_t*(-deriv_exp_1_d0*(((modelStruct.modelPar_ze*(-deriv_log_0_d0*(d_aje_t_dX))-(-value_log_0)*modelStruct.d_modelPar_ze_dX)/modelStruct.modelPar_ze/modelStruct.modelPar_ze)))+d_vde_t_dX*(1.0-value_exp_1));
vf = (vde_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vbiei_dX)-(vf-Vbiei)*d_VT_dX)/VT/VT);
xvf = ((vf-Vbiei)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_ze_dX);
x = (1.0-modelStruct.modelPar_ze);
{
double value_log_0 = log((1.0-(v_j/vde_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vde_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vde_t*d_v_j_dX-v_j*d_vde_t_dX)/vde_t/vde_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
instanceStruct.d_instanceVar_qjei_dX = (((x*((cje0_t*vde_t)*d_y_dX+(cje0_t*d_vde_t_dX+d_cje0_t_dX*vde_t)*y)-((cje0_t*vde_t)*y)*d_x_dX)/x/x)+((aje_t*cje0_t)*(d_Vbiei_dX-d_v_j_dX)+(aje_t*d_cje0_t_dX+d_aje_t_dX*cje0_t)*(Vbiei-v_j)));
instanceStruct.instanceVar_qjei = ((((cje0_t*vde_t)*y)/x)+((aje_t*cje0_t)*(Vbiei-v_j)));
}
else
{
instanceStruct.d_instanceVar_qjei_dX = 0.0;
instanceStruct.instanceVar_qjei = 0.00;
}
d_qje_dX = ((cje0_t*instanceStruct.d_instanceVar_qjei_dX-instanceStruct.instanceVar_qjei*d_cje0_t_dX)/cje0_t/cje0_t);
qje = (instanceStruct.instanceVar_qjei/cje0_t);
if ((rbi0_t>0.0))
//Begin block HICRBI
{
d_Qz_nom_dX = (((((modelStruct.modelPar_vr0e*d_qje_dX-qje*modelStruct.d_modelPar_vr0e_dX)/modelStruct.modelPar_vr0e/modelStruct.modelPar_vr0e)+((modelStruct.modelPar_vr0c*instanceStruct.d_instanceVar_qjci_dX-instanceStruct.instanceVar_qjci*modelStruct.d_modelPar_vr0c_dX)/modelStruct.modelPar_vr0c/modelStruct.modelPar_vr0c))+((ickf*d_itf_dX-itf*d_ickf_dX)/ickf/ickf))+((ickr*d_itr_dX-itr*d_ickr_dX)/ickr/ickr));
Qz_nom = ((((1+(qje/modelStruct.modelPar_vr0e))+(instanceStruct.instanceVar_qjci/modelStruct.modelPar_vr0c))+(itf/ickf))+(itr/ickr));
{
double value_sqrt_0 = sqrt(((Qz_nom*Qz_nom)+0.01));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_fQz_dX = 0.5*(d_Qz_nom_dX+deriv_sqrt_0_d0*((Qz_nom*d_Qz_nom_dX+d_Qz_nom_dX*Qz_nom)));
fQz = (0.5*(Qz_nom+value_sqrt_0));
}
d_rbi_dX = ((fQz*d_rbi0_t_dX-rbi0_t*d_fQz_dX)/fQz/fQz);
rbi = (rbi0_t/fQz);
if ((ibi>0.0))
{
d_eta_dX = ((VT*((modelStruct.modelPar_fgeo*rbi)*d_ibi_dX+(modelStruct.modelPar_fgeo*d_rbi_dX+modelStruct.d_modelPar_fgeo_dX*rbi)*ibi)-((modelStruct.modelPar_fgeo*rbi)*ibi)*d_VT_dX)/VT/VT);
eta = (((modelStruct.modelPar_fgeo*rbi)*ibi)/VT);
if ((eta<1e-6))
{
d_rbi_dX = (rbi*(-0.5*d_eta_dX)+d_rbi_dX*(1-(0.5*eta)));
rbi = (rbi*(1-(0.5*eta)));
}
else
{
{
double value_log_0 = log((eta+1));
double  deriv_log_0_d0 = (1.0/(eta+1));
d_rbi_dX = ((eta*(rbi*deriv_log_0_d0*(d_eta_dX)+d_rbi_dX*value_log_0)-(rbi*value_log_0)*d_eta_dX)/eta/eta);
rbi = ((rbi*value_log_0)/eta);
}
}
}
}
// End block HICRBI
else
{
d_rbi_dX = 0.0;
rbi = 0.0;
}
d_rb_dX = (d_rbi_dX+d_rbx_t_dX);
rb = (rbi+rbx_t);
if ((modelStruct.modelPar_itss>0.0))
//Begin block Sub_Transfer
{
d_HSUM_dX = (modelStruct.modelPar_msf*d_VT_dX+modelStruct.d_modelPar_msf_dX*VT);
HSUM = (modelStruct.modelPar_msf*VT);
{
double value_limexp_0 = limexp((Vbci/HSUM));
double  deriv_limexp_0_d0 = ((((Vbci/HSUM))<80)?(value_limexp_0):exp(80.0));
d_HSa_dX = deriv_limexp_0_d0*(((HSUM*d_Vbci_dX-Vbci*d_HSUM_dX)/HSUM/HSUM));
HSa = value_limexp_0;
}
{
double value_limexp_0 = limexp((Vsci/HSUM));
double  deriv_limexp_0_d0 = ((((Vsci/HSUM))<80)?(value_limexp_0):exp(80.0));
d_HSb_dX = deriv_limexp_0_d0*(((HSUM*d_Vsci_dX-Vsci*d_HSUM_dX)/HSUM/HSUM));
HSb = value_limexp_0;
}
d_HSI_Tsu_dX = (itss_t*(d_HSa_dX-d_HSb_dX)+d_itss_t_dX*(HSa-HSb));
HSI_Tsu = (itss_t*(HSa-HSb));
}
// End block Sub_Transfer
else
{
d_HSI_Tsu_dX = 0.0;
HSI_Tsu = 0.0;
}
d_DIOY_dX = (((modelStruct.modelPar_msc*VT)*d_Vsci_dX-Vsci*(modelStruct.modelPar_msc*d_VT_dX+modelStruct.d_modelPar_msc_dX*VT))/(modelStruct.modelPar_msc*VT)/(modelStruct.modelPar_msc*VT));
DIOY = (Vsci/(modelStruct.modelPar_msc*VT));
if ((modelStruct.modelPar_iscs>0.0))
{
if ((DIOY>80))
{
d_le_dX = d_DIOY_dX;
le = (1+(DIOY-80));
d_DIOY_dX = 0.0;
DIOY = 80;
}
else
{
d_le_dX = 0.0;
le = 1;
}
{
double value_limexp_0 = limexp(DIOY);
double  deriv_limexp_0_d0 = (((DIOY)<80)?(value_limexp_0):exp(80.0));
d_le_dX = (le*deriv_limexp_0_d0*(d_DIOY_dX)+d_le_dX*value_limexp_0);
le = (le*value_limexp_0);
}
instanceStruct.d_instanceVar_ijsc_dX = (iscs_t*d_le_dX+d_iscs_t_dX*(le-1.0));
instanceStruct.instanceVar_ijsc = (iscs_t*(le-1.0));
if ((DIOY<=(-14.0)))
{
instanceStruct.d_instanceVar_ijsc_dX = (-d_iscs_t_dX);
instanceStruct.instanceVar_ijsc = (-iscs_t);
}
}
else
{
instanceStruct.d_instanceVar_ijsc_dX = 0.0;
instanceStruct.instanceVar_ijsc = 0.0;
}
if ((modelStruct.modelPar_vpts<1.0e2))
{
if ((cjs0_t>0.0))
{
d_zr_dX = (modelStruct.d_modelPar_zs_dX/4.0);
zr = (modelStruct.modelPar_zs/4.0);
d_vp_dX = (modelStruct.d_modelPar_vpts_dX-d_vds_t_dX);
vp = (modelStruct.modelPar_vpts-vds_t);
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zs));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vds_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zs_dX/modelStruct.modelPar_zs/modelStruct.modelPar_zs)))+d_vds_t_dX*(1.0-value_exp_1));
vf = (vds_t*(1.0-value_exp_1));
}
d_cmax_dX = 2.4*d_cjs0_t_dX;
cmax = (2.4*cjs0_t);
{
double value_log_0 = log((vds_t/modelStruct.modelPar_vpts));
double value_exp_1 = exp(((modelStruct.modelPar_zs-zr)*value_log_0));
double  deriv_log_0_d0 = (1.0/(vds_t/modelStruct.modelPar_vpts));
double  deriv_exp_1_d0 = value_exp_1;
d_cr_dX = (cjs0_t*deriv_exp_1_d0*(((modelStruct.modelPar_zs-zr)*deriv_log_0_d0*(((modelStruct.modelPar_vpts*d_vds_t_dX-vds_t*modelStruct.d_modelPar_vpts_dX)/modelStruct.modelPar_vpts/modelStruct.modelPar_vpts))+(modelStruct.d_modelPar_zs_dX-d_zr_dX)*value_log_0))+d_cjs0_t_dX*value_exp_1);
cr = (cjs0_t*value_exp_1);
}
d_a_dX = d_VT_dX;
a = VT;
d_ve_dX = ((a*(d_vf_dX-d_Vsci_dX)-(vf-Vsci)*d_a_dX)/a/a);
ve = ((vf-Vsci)/a);
if ((ve<=80.0))
{
{
double value_exp_0 = exp(ve);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_ve_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj1_dX = (d_vf_dX-(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj1 = (vf-(a*value_log_0));
}
}
else
{
d_vj1_dX = d_Vsci_dX;
vj1 = Vsci;
}
d_a_dX = (0.1*d_vp_dX+4.0*d_VT_dX);
a = ((0.1*vp)+(4.0*VT));
d_vr_dX = ((a*(d_vp_dX+d_vj1_dX)-(vp+vj1)*d_a_dX)/a/a);
vr = ((vp+vj1)/a);
if ((vr<=80.0))
{
{
double value_exp_0 = exp(vr);
double  deriv_exp_0_d0 = value_exp_0;
d_ex1_dX = deriv_exp_0_d0*(d_vr_dX);
ex1 = value_exp_0;
}
d_ee1_dX = d_ex1_dX;
ee1 = (1.0+ex1);
{
double value_log_0 = log(ee1);
double  deriv_log_0_d0 = (1.0/ee1);
d_vj2_dX = ((-d_vp_dX)+(a*deriv_log_0_d0*(d_ee1_dX)+d_a_dX*value_log_0));
vj2 = ((-vp)+(a*value_log_0));
}
}
else
{
d_vj2_dX = d_vj1_dX;
vj2 = vj1;
}
d_vj4_dX = (d_Vsci_dX-d_vj1_dX);
vj4 = (Vsci-vj1);
d_ez_dX = (-modelStruct.d_modelPar_zs_dX);
ez = (1.0-modelStruct.modelPar_zs);
d_ezr_dX = (-d_zr_dX);
ezr = (1.0-zr);
{
double value_log_0 = log((1.0-(vj1/vds_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj1/vds_t)));
d_vdj1_dX = deriv_log_0_d0*((-((vds_t*d_vj1_dX-vj1*d_vds_t_dX)/vds_t/vds_t)));
vdj1 = value_log_0;
}
{
double value_log_0 = log((1.0-(vj2/vds_t)));
double  deriv_log_0_d0 = (1.0/(1.0-(vj2/vds_t)));
d_vdj2_dX = deriv_log_0_d0*((-((vds_t*d_vj2_dX-vj2*d_vds_t_dX)/vds_t/vds_t)));
vdj2 = value_log_0;
}
{
double value_exp_0 = exp((vdj2*ez));
double  deriv_exp_0_d0 = value_exp_0;
d_qj1_dX = ((ez*(cjs0_t*(-deriv_exp_0_d0*((vdj2*d_ez_dX+d_vdj2_dX*ez)))+d_cjs0_t_dX*(1.0-value_exp_0))-(cjs0_t*(1.0-value_exp_0))*d_ez_dX)/ez/ez);
qj1 = ((cjs0_t*(1.0-value_exp_0))/ez);
}
{
double value_exp_0 = exp((vdj1*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj2_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj1*d_ezr_dX+d_vdj1_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj2 = ((cr*(1.0-value_exp_0))/ezr);
}
{
double value_exp_0 = exp((vdj2*ezr));
double  deriv_exp_0_d0 = value_exp_0;
d_qj3_dX = ((ezr*(cr*(-deriv_exp_0_d0*((vdj2*d_ezr_dX+d_vdj2_dX*ezr)))+d_cr_dX*(1.0-value_exp_0))-(cr*(1.0-value_exp_0))*d_ezr_dX)/ezr/ezr);
qj3 = ((cr*(1.0-value_exp_0))/ezr);
}
d_qjs_dX = ((((qj1+qj2)-qj3)*d_vds_t_dX+((d_qj1_dX+d_qj2_dX)-d_qj3_dX)*vds_t)+(cmax*d_vj4_dX+d_cmax_dX*vj4));
qjs = ((((qj1+qj2)-qj3)*vds_t)+(cmax*vj4));
}
else
{
d_qjs_dX = 0.0;
qjs = 0.0;
}
}
else
{
if ((cjs0_t>0.0))
{
{
double value_log_0 = log(static_cast<double>(2.4));
double value_exp_1 = exp(((-value_log_0)/modelStruct.modelPar_zs));
double  deriv_exp_1_d0 = value_exp_1;
d_vf_dX = (vds_t*(-deriv_exp_1_d0*((-(-value_log_0)*modelStruct.d_modelPar_zs_dX/modelStruct.modelPar_zs/modelStruct.modelPar_zs)))+d_vds_t_dX*(1.0-value_exp_1));
vf = (vds_t*(1.0-value_exp_1));
}
d_xvf_dX = ((VT*(d_vf_dX-d_Vsci_dX)-(vf-Vsci)*d_VT_dX)/VT/VT);
xvf = ((vf-Vsci)/VT);
{
double value_sqrt_0 = sqrt(((xvf*xvf)+1.921812));
double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
d_xvf2_dX = deriv_sqrt_0_d0*((xvf*d_xvf_dX+d_xvf_dX*xvf));
xvf2 = value_sqrt_0;
}
d_v_j_dX = (d_vf_dX-(VT*(d_xvf_dX+d_xvf2_dX)+d_VT_dX*(xvf+xvf2))*0.5);
v_j = (vf-((VT*(xvf+xvf2))*0.5));
d_x_dX = (-modelStruct.d_modelPar_zs_dX);
x = (1.0-modelStruct.modelPar_zs);
{
double value_log_0 = log((1.0-(v_j/vds_t)));
double value_exp_1 = exp((x*value_log_0));
double  deriv_log_0_d0 = (1.0/(1.0-(v_j/vds_t)));
double  deriv_exp_1_d0 = value_exp_1;
d_y_dX = (-deriv_exp_1_d0*((x*deriv_log_0_d0*((-((vds_t*d_v_j_dX-v_j*d_vds_t_dX)/vds_t/vds_t)))+d_x_dX*value_log_0)));
y = (1.0-value_exp_1);
}
d_qjs_dX = (((x*((cjs0_t*vds_t)*d_y_dX+(cjs0_t*d_vds_t_dX+d_cjs0_t_dX*vds_t)*y)-((cjs0_t*vds_t)*y)*d_x_dX)/x/x)+((2.4*cjs0_t)*(d_Vsci_dX-d_v_j_dX)+2.4*d_cjs0_t_dX*(Vsci-v_j)));
qjs = ((((cjs0_t*vds_t)*y)/x)+((2.4*cjs0_t)*(Vsci-v_j)));
}
else
{
d_qjs_dX = 0.0;
qjs = 0.00;
}
}
d_pterm_dX = 0.0;
pterm = 0;
if (((modelStruct.modelPar_flsh==1)&&(modelStruct.modelPar_rth>=0.001)))
{
d_pterm_dX = ((instanceStruct.instanceVar_it*d_Vciei_dX+instanceStruct.d_instanceVar_it_dX*Vciei)+(instanceStruct.instanceVar_iavl*(d_vdci_t_dX-d_Vbici_dX)+instanceStruct.d_instanceVar_iavl_dX*(vdci_t-Vbici)));
pterm = ((instanceStruct.instanceVar_it*Vciei)+(instanceStruct.instanceVar_iavl*(vdci_t-Vbici)));
}
else
{
if (((modelStruct.modelPar_flsh==2)&&(modelStruct.modelPar_rth>=0.001)))
{
d_pterm_dX = (((((Vciei*instanceStruct.d_instanceVar_it_dX+d_Vciei_dX*instanceStruct.instanceVar_it)+((vdci_t-Vbici)*instanceStruct.d_instanceVar_iavl_dX+(d_vdci_t_dX-d_Vbici_dX)*instanceStruct.instanceVar_iavl))+(instanceStruct.instanceVar_ijbe*d_Vbiei_dX+instanceStruct.d_instanceVar_ijbe_dX*Vbiei))+(instanceStruct.instanceVar_ijbc*d_Vbici_dX+instanceStruct.d_instanceVar_ijbc_dX*Vbici))+(instanceStruct.instanceVar_ijsc*d_Vsci_dX+instanceStruct.d_instanceVar_ijsc_dX*Vsci));
pterm = (((((Vciei*instanceStruct.instanceVar_it)+((vdci_t-Vbici)*instanceStruct.instanceVar_iavl))+(instanceStruct.instanceVar_ijbe*Vbiei))+(instanceStruct.instanceVar_ijbc*Vbici))+(instanceStruct.instanceVar_ijsc*Vsci));
if ((rb>=0.001))
{
d_pterm_dX = (d_pterm_dX+(-(Vbbi*Vbbi)*d_rb_dX/rb/rb));
pterm = (pterm+((Vbbi*Vbbi)/rb));
}
if ((modelStruct.modelPar_re>=0.001))
{
d_pterm_dX = (d_pterm_dX+(-(Veie*Veie)*d_re_t_dX/re_t/re_t));
pterm = (pterm+((Veie*Veie)/re_t));
}
if ((modelStruct.modelPar_rcx>=0.001))
{
d_pterm_dX = (d_pterm_dX+(-(Vcic*Vcic)*d_rcx_t_dX/rcx_t/rcx_t));
pterm = (pterm+((Vcic*Vcic)/rcx_t));
}
}
}
d_Itxf_dX = d_itf_dX;
Itxf = itf;
d_Qdeix_dX = d_qf_dX;
Qdeix = qf;
if (((modelStruct.modelPar_flnqs!=0)&&(tf!=0)))
{
Vxf1 = (probeVars[admsProbeID_V_xf1_GND]);
Vxf2 = (probeVars[admsProbeID_V_xf2_GND]);
d_Ixf1_dX = (((Vxf2-itf)/tf)*modelStruct.d_modelPar_t0_dX+((tf*(-d_itf_dX)-(Vxf2-itf)*d_tf_dX)/tf/tf)*modelStruct.modelPar_t0);
Ixf1 = (((Vxf2-itf)/tf)*modelStruct.modelPar_t0);
d_Ixf2_dX = (((Vxf2-Vxf1)/tf)*modelStruct.d_modelPar_t0_dX+(-(Vxf2-Vxf1)*d_tf_dX/tf/tf)*modelStruct.modelPar_t0);
Ixf2 = (((Vxf2-Vxf1)/tf)*modelStruct.modelPar_t0);
d_Qxf1_dX = ((modelStruct.modelPar_alit*Vxf1)*modelStruct.d_modelPar_t0_dX+modelStruct.d_modelPar_alit_dX*Vxf1*modelStruct.modelPar_t0);
Qxf1 = ((modelStruct.modelPar_alit*Vxf1)*modelStruct.modelPar_t0);
d_Qxf2_dX = (((modelStruct.modelPar_alit*Vxf2)/3)*modelStruct.d_modelPar_t0_dX+(modelStruct.d_modelPar_alit_dX*Vxf2/3)*modelStruct.modelPar_t0);
Qxf2 = (((modelStruct.modelPar_alit*Vxf2)/3)*modelStruct.modelPar_t0);
d_Itxf_dX = 0.0;
Itxf = Vxf2;
Vxf = (probeVars[admsProbeID_V_xf_GND]);
d_fact_dX = ((tf*modelStruct.d_modelPar_t0_dX-modelStruct.modelPar_t0*d_tf_dX)/tf/tf);
fact = (modelStruct.modelPar_t0/tf);
d_Ixf_dX = ((Vxf-qf)*d_fact_dX+(-d_qf_dX)*fact);
Ixf = ((Vxf-qf)*fact);
d_Qxf_dX = ((modelStruct.modelPar_alqf*Vxf)*modelStruct.d_modelPar_t0_dX+modelStruct.d_modelPar_alqf_dX*Vxf*modelStruct.modelPar_t0);
Qxf = ((modelStruct.modelPar_alqf*Vxf)*modelStruct.modelPar_t0);
d_Qdeix_dX = 0.0;
Qdeix = Vxf;
}
else
{
d_Ixf1_dX = 0.0;
Ixf1 = (probeVars[admsProbeID_V_xf1_GND]);
d_Ixf2_dX = 0.0;
Ixf2 = (probeVars[admsProbeID_V_xf2_GND]);
d_Qxf1_dX = 0.0;
Qxf1 = 0;
d_Qxf2_dX = 0.0;
Qxf2 = 0;
d_Ixf_dX = 0.0;
Ixf = (probeVars[admsProbeID_V_xf_GND]);
d_Qxf_dX = 0.0;
Qxf = 0;
}
instanceStruct.d_instanceVar_Ibici_dX = (instanceStruct.d_instanceVar_ijbc_dX-instanceStruct.d_instanceVar_iavl_dX);
instanceStruct.instanceVar_Ibici = (instanceStruct.instanceVar_ijbc-instanceStruct.instanceVar_iavl);
d_Qbci_dX = (modelStruct.modelPar_cbcpar*d_Vbci_dX+modelStruct.d_modelPar_cbcpar_dX*Vbci);
Qbci = (modelStruct.modelPar_cbcpar*Vbci);
d_Qbe_dX = (modelStruct.modelPar_cbepar*d_Vbe_dX+modelStruct.d_modelPar_cbepar_dX*Vbe);
Qbe = (modelStruct.modelPar_cbepar*Vbe);
d_Qbici_dX = (d_qjcii_dX+d_qr_dX);
Qbici = (qjcii+qr);
d_Qbiei_dX = (instanceStruct.d_instanceVar_qjei_dX+d_Qdeix_dX);
Qbiei = (instanceStruct.instanceVar_qjei+Qdeix);
instanceStruct.d_instanceVar_ijsc_dX = (HICUMtype*instanceStruct.d_instanceVar_ijsc_dX+d_HICUMtype_dX*instanceStruct.instanceVar_ijsc);
instanceStruct.instanceVar_ijsc = (HICUMtype*instanceStruct.instanceVar_ijsc);
d_qjs_dX = (HICUMtype*d_qjs_dX+d_HICUMtype_dX*qjs);
qjs = (HICUMtype*qjs);
d_qjcx_dX = (HICUMtype*d_qjcx_dX+d_HICUMtype_dX*qjcx);
qjcx = (HICUMtype*qjcx);
d_Qbci_dX = (HICUMtype*d_Qbci_dX+d_HICUMtype_dX*Qbci);
Qbci = (HICUMtype*Qbci);
d_Qbe_dX = (HICUMtype*d_Qbe_dX+d_HICUMtype_dX*Qbe);
Qbe = (HICUMtype*Qbe);
instanceStruct.d_instanceVar_Ibici_dX = (HICUMtype*instanceStruct.d_instanceVar_Ibici_dX+d_HICUMtype_dX*instanceStruct.instanceVar_Ibici);
instanceStruct.instanceVar_Ibici = (HICUMtype*instanceStruct.instanceVar_Ibici);
d_Qbici_dX = (HICUMtype*d_Qbici_dX+d_HICUMtype_dX*Qbici);
Qbici = (HICUMtype*Qbici);
instanceStruct.d_instanceVar_ijbe_dX = (HICUMtype*instanceStruct.d_instanceVar_ijbe_dX+d_HICUMtype_dX*instanceStruct.instanceVar_ijbe);
instanceStruct.instanceVar_ijbe = (HICUMtype*instanceStruct.instanceVar_ijbe);
d_Qbiei_dX = (HICUMtype*d_Qbiei_dX+d_HICUMtype_dX*Qbiei);
Qbiei = (HICUMtype*Qbiei);
d_it_wop_dX = (HICUMtype*instanceStruct.d_instanceVar_it_dX+d_HICUMtype_dX*instanceStruct.instanceVar_it);
it_wop = (HICUMtype*instanceStruct.instanceVar_it);
instanceStruct.d_instanceVar_it_dX = (HICUMtype*(d_Itxf_dX-d_itr_dX)+d_HICUMtype_dX*(Itxf-itr));
instanceStruct.instanceVar_it = (HICUMtype*(Itxf-itr));
instanceStruct.d_instanceVar_iavl_dX = (HICUMtype*instanceStruct.d_instanceVar_iavl_dX+d_HICUMtype_dX*instanceStruct.instanceVar_iavl);
instanceStruct.instanceVar_iavl = (HICUMtype*instanceStruct.instanceVar_iavl);
// I(bi,ei) <+ (($simparam("gmin",1e-12)*V(bi,ei)))
d_staticContributions_dX[admsNodeID_bi]+= 0.0;
d_staticContributions_dX[(admsNodeID_ei)]-= 0.0;
// I(bi,ci) <+ (($simparam("gmin",1e-12)*V(bi,ci)))
d_staticContributions_dX[admsNodeID_bi]+= 0.0;
d_staticContributions_dX[(admsNodeID_ci)]-= 0.0;
// I(ci,ei) <+ (($simparam("gmin",1e-12)*V(ci,ei)))
d_staticContributions_dX[admsNodeID_ci]+= 0.0;
d_staticContributions_dX[(admsNodeID_ei)]-= 0.0;
// I(b,s) <+ ((HICUMtype*HSI_Tsu))
d_staticContributions_dX[admsNodeID_b]+= (HICUMtype*d_HSI_Tsu_dX+d_HICUMtype_dX*HSI_Tsu);
d_staticContributions_dX[(admsNodeID_s)]-= (HICUMtype*d_HSI_Tsu_dX+d_HICUMtype_dX*HSI_Tsu);
// I(s,ci) <+ (ijsc)
d_staticContributions_dX[admsNodeID_s]+= instanceStruct.d_instanceVar_ijsc_dX;
d_staticContributions_dX[(admsNodeID_ci)]-= instanceStruct.d_instanceVar_ijsc_dX;
// I(s,ci) <+ (ddt(qjs))
d_dynamicContributions_dX[admsNodeID_s]+= (d_qjs_dX);
d_dynamicContributions_dX[(admsNodeID_ci)]-= (d_qjs_dX);
// I(b,ci) <+ (ddt(qjcx))
d_dynamicContributions_dX[admsNodeID_b]+= (d_qjcx_dX);
d_dynamicContributions_dX[(admsNodeID_ci)]-= (d_qjcx_dX);
// I(b,ci) <+ (ddt(Qbci))
d_dynamicContributions_dX[admsNodeID_b]+= (d_Qbci_dX);
d_dynamicContributions_dX[(admsNodeID_ci)]-= (d_Qbci_dX);
// I(b,e) <+ (ddt(Qbe))
d_dynamicContributions_dX[admsNodeID_b]+= (d_Qbe_dX);
d_dynamicContributions_dX[(admsNodeID_e)]-= (d_Qbe_dX);
if ((modelStruct.modelPar_re>=0.001))
{
// I(ei,e) <+ ((Veie/re_t))
d_staticContributions_dX[admsNodeID_ei]+= (-Veie*d_re_t_dX/re_t/re_t);
d_staticContributions_dX[(admsNodeID_e)]-= (-Veie*d_re_t_dX/re_t/re_t);
}
else
{
// V(ei,e) <+ (0.0)
// do nothing at all
}
if ((modelStruct.modelPar_rcx>=0.001))
{
// I(ci,c) <+ ((Vcic/rcx_t))
d_staticContributions_dX[admsNodeID_ci]+= (-Vcic*d_rcx_t_dX/rcx_t/rcx_t);
d_staticContributions_dX[(admsNodeID_c)]-= (-Vcic*d_rcx_t_dX/rcx_t/rcx_t);
}
else
{
// V(ci,c) <+ (0.0)
// do nothing at all
}
if (((modelStruct.modelPar_rbi0>=0.001)||(modelStruct.modelPar_rbx>=0.001)))
{
// I(b,bi) <+ ((Vbbi/rb))
d_staticContributions_dX[admsNodeID_b]+= (-Vbbi*d_rb_dX/rb/rb);
d_staticContributions_dX[(admsNodeID_bi)]-= (-Vbbi*d_rb_dX/rb/rb);
}
else
{
// V(b,bi) <+ (0.0)
// do nothing at all
}
// I(bi,ci) <+ (Ibici)
d_staticContributions_dX[admsNodeID_bi]+= instanceStruct.d_instanceVar_Ibici_dX;
d_staticContributions_dX[(admsNodeID_ci)]-= instanceStruct.d_instanceVar_Ibici_dX;
// I(bi,ci) <+ (ddt(Qbici))
d_dynamicContributions_dX[admsNodeID_bi]+= (d_Qbici_dX);
d_dynamicContributions_dX[(admsNodeID_ci)]-= (d_Qbici_dX);
// I(bi,ei) <+ (ijbe)
d_staticContributions_dX[admsNodeID_bi]+= instanceStruct.d_instanceVar_ijbe_dX;
d_staticContributions_dX[(admsNodeID_ei)]-= instanceStruct.d_instanceVar_ijbe_dX;
// I(bi,ei) <+ (ddt(Qbiei))
d_dynamicContributions_dX[admsNodeID_bi]+= (d_Qbiei_dX);
d_dynamicContributions_dX[(admsNodeID_ei)]-= (d_Qbiei_dX);
// I(ci,ei) <+ (it)
d_staticContributions_dX[admsNodeID_ci]+= instanceStruct.d_instanceVar_it_dX;
d_staticContributions_dX[(admsNodeID_ei)]-= instanceStruct.d_instanceVar_it_dX;
if (((modelStruct.modelPar_flsh==0)||(modelStruct.modelPar_rth<0.001)))
{
// I(tnode,GND) <+ ((Vrth/0.001))
d_staticContributions_dX[admsNodeID_tnode]+= 0.0;
}
else
{
// I(tnode,GND) <+ (((Vrth/rth)-pterm))
d_staticContributions_dX[admsNodeID_tnode]+= ((-Vrth*modelStruct.d_modelPar_rth_dX/modelStruct.modelPar_rth/modelStruct.modelPar_rth)-d_pterm_dX);
// I(tnode,GND) <+ (ddt((cth*Vrth)))
d_dynamicContributions_dX[admsNodeID_tnode]+= (modelStruct.d_modelPar_cth_dX*Vrth);
}
// I(xf1,GND) <+ (Ixf1)
d_staticContributions_dX[admsNodeID_xf1]+= d_Ixf1_dX;
// I(xf1,GND) <+ (ddt(Qxf1))
d_dynamicContributions_dX[admsNodeID_xf1]+= (d_Qxf1_dX);
// I(xf2,GND) <+ (Ixf2)
d_staticContributions_dX[admsNodeID_xf2]+= d_Ixf2_dX;
// I(xf2,GND) <+ (ddt(Qxf2))
d_dynamicContributions_dX[admsNodeID_xf2]+= (d_Qxf2_dX);
// I(xf,GND) <+ (Ixf)
d_staticContributions_dX[admsNodeID_xf]+= d_Ixf_dX;
// I(xf,GND) <+ (ddt(Qxf))
d_dynamicContributions_dX[admsNodeID_xf]+= (d_Qxf_dX);
d_fourkt_dX = (4.0*1.3806503e-23)*d_Tdev_dX;
fourkt = ((4.0*1.3806503e-23)*Tdev);
if (((modelStruct.modelPar_rbx>=0.001)||(modelStruct.modelPar_rbi0>=0.001)))
{
// I(b,bi) <+ (white_noise((fourkt/rb)))
}
if ((modelStruct.modelPar_rcx>=0.001))
{
// I(ci,c) <+ (white_noise((fourkt/rcx_t)))
}
if ((modelStruct.modelPar_re>=0.001))
{
// I(ei,e) <+ (white_noise((fourkt/re_t)))
}
twoq = (2.0*1.6021766208e-19);
// I(bi,ei) <+ (white_noise((twoq*ijbe)))
// I(ci,ei) <+ (white_noise((twoq*it)))
{
double value_pow_0 = pow(instanceStruct.instanceVar_ijbe,modelStruct.modelPar_af);
double  deriv_pow_0_d0 = ((instanceStruct.instanceVar_ijbe == 0.0)?0.0:(value_pow_0*modelStruct.modelPar_af/instanceStruct.instanceVar_ijbe));
double  deriv_pow_0_d1 = (instanceStruct.instanceVar_ijbe == 0.0)?0.0:(log(instanceStruct.instanceVar_ijbe)*value_pow_0);
d_flicker_Pwr_dX = (modelStruct.modelPar_kf*((deriv_pow_0_d0*(instanceStruct.d_instanceVar_ijbe_dX))+(deriv_pow_0_d1*(modelStruct.d_modelPar_af_dX)))+modelStruct.d_modelPar_kf_dX*value_pow_0);
flicker_Pwr = (modelStruct.modelPar_kf*value_pow_0);
}
// I(bi,ei) <+ (flicker_noise(flicker_Pwr,1.0))
//Begin block OP_calculation
{
//Block-local variables for block OP_calculation
double oRPIi=0.0;
double d_oRPIi_dX=0.0;
double oRMUi=0.0;
double d_oRMUi_dX=0.0;
double oROi=0.0;
double d_oROi_dX=0.0;
double gAVL=0.0;
double d_gAVL_dX=0.0;
//End of Block-local variables
//Block-local variables for block OP_calculation
double Cdei=0.0;
double d_Cdei_dX=0.0;
double Cdci=0.0;
double d_Cdci_dX=0.0;
double Cjei=0.0;
double d_Cjei_dX=0.0;
double Cjci=0.0;
double d_Cjci_dX=0.0;
double Cjcx=0.0;
double d_Cjcx_dX=0.0;
double CBC=0.0;
double d_CBC_dX=0.0;
//End of Block-local variables
//Block-local variables for block OP_calculation
double R_tot=0.0;
double d_R_tot_dX=0.0;
//End of Block-local variables
d_oRPIi_dX = 0.0;
oRPIi = 0.0 /*FIXME: ddx(ijbe,V(bi,GND)) not implemented in sensitivity context */;
d_oRMUi_dX = 0.0;
oRMUi = ((-1)*0.0 /*FIXME: ddx(Ibici,V(ci,GND)) not implemented in sensitivity context */);
d_gAVL_dX = d_HICUMtype_dX*0.0 /*FIXME: ddx(iavl,V(ci,GND)) not implemented in sensitivity context */;
gAVL = (HICUMtype*0.0 /*FIXME: ddx(iavl,V(ci,GND)) not implemented in sensitivity context */);
d_oROi_dX = 0.0;
oROi = 0.0 /*FIXME: ddx(it_wop,V(ci,GND)) not implemented in sensitivity context */;
d_Cdei_dX = (-1)*d_HICUMtype_dX*0.0 /*FIXME: ddx(qf,V(ei,GND)) not implemented in sensitivity context */;
Cdei = (((-1)*HICUMtype)*0.0 /*FIXME: ddx(qf,V(ei,GND)) not implemented in sensitivity context */);
d_Cjei_dX = 0.0;
Cjei = 0.0 /*FIXME: ddx(qjei,V(bi,GND)) not implemented in sensitivity context */;
d_Cdci_dX = (-1)*d_HICUMtype_dX*0.0 /*FIXME: ddx(qr,V(ci,GND)) not implemented in sensitivity context */;
Cdci = (((-1)*HICUMtype)*0.0 /*FIXME: ddx(qr,V(ci,GND)) not implemented in sensitivity context */);
d_Cjci_dX = 0.0;
Cjci = 0.0 /*FIXME: ddx(qjci_int,V(bi,GND)) not implemented in sensitivity context */;
d_Cjcx_dX = 0.0;
Cjcx = ((-1)*0.0 /*FIXME: ddx(qjcxi,V(ci,GND)) not implemented in sensitivity context */);
}
// End block OP_calculation
}



//-----------------------------------------------------------------------------
// Function      : InstanceSensitivity::operator()
// Purpose       : return sensitivity for a single instance parameter
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
/// Compute sensitivity of a device instance's outputs to a specified instance
/// parameter
///
///
/// @param[in] entity  The device entity that owns the parameter
/// @param[in] name    The unadorned parameter name specific to the entity
/// @param[out] dfdp   The derivative of the F vector with respect to the parameter
/// @param[out] dqdp   The derivative of the Q vector with respect to the parameter
/// @param[out] dbdp   The derivative of the B vector with respect to the parameter
/// @param[out] Findices   The indices into the F vector corresponding to the elements of dfdp
/// @param[out] Qindices   The indices into the Q vector corresponding to the elements of dfdp
/// @param[out] Bindices   The indices into the B vector corresponding to the elements of dfdp
///
///
void InstanceSensitivity::operator()
(
const ParameterBase &entity,
const std::string &name,
std::vector<double> & dfdp,
std::vector<double> & dqdp,
std::vector<double> & dbdp,
std::vector<int> & Findices,
std::vector<int> & Qindices,
std::vector<int> & Bindices
) const
{
const ParameterBase * e1 = &entity;
const Instance & in = *(dynamic_cast<const Instance *> (e1));
const Model & mod =in.model_;

dfdp.resize(11+0);
dqdp.resize(11+0);
Findices.resize(11+0);
Qindices.resize(11+0);

std::vector <double> probeVars(20);
std::vector <double> d_staticContributions_dX(11+0);
std::vector <double> d_dynamicContributions_dX(11+0);


// initialize contributions to zero (automatically sets derivatives to zero)
for (int i=0; i < 11+0 ; ++i)
{
   d_staticContributions_dX[i]=0;
   d_dynamicContributions_dX[i]=0;
}

// Copy out all the model parameters (doubles) into local structure
modelSensStruct modelStruct;

//reals
modelStruct.modelPar_is=mod.is;
modelStruct.d_modelPar_is_dX=0.0;
modelStruct.modelPar_given_is=mod.given("is");
modelStruct.modelPar_mcf=mod.mcf;
modelStruct.d_modelPar_mcf_dX=0.0;
modelStruct.modelPar_given_mcf=mod.given("mcf");
modelStruct.modelPar_mcr=mod.mcr;
modelStruct.d_modelPar_mcr_dX=0.0;
modelStruct.modelPar_given_mcr=mod.given("mcr");
modelStruct.modelPar_vef=mod.vef;
modelStruct.d_modelPar_vef_dX=0.0;
modelStruct.modelPar_given_vef=mod.given("vef");
modelStruct.modelPar_ver=mod.ver;
modelStruct.d_modelPar_ver_dX=0.0;
modelStruct.modelPar_given_ver=mod.given("ver");
modelStruct.modelPar_aver=mod.aver;
modelStruct.d_modelPar_aver_dX=0.0;
modelStruct.modelPar_given_aver=mod.given("aver");
modelStruct.modelPar_iqf=mod.iqf;
modelStruct.d_modelPar_iqf_dX=0.0;
modelStruct.modelPar_given_iqf=mod.given("iqf");
modelStruct.modelPar_fiqf=mod.fiqf;
modelStruct.d_modelPar_fiqf_dX=0.0;
modelStruct.modelPar_given_fiqf=mod.given("fiqf");
modelStruct.modelPar_iqr=mod.iqr;
modelStruct.d_modelPar_iqr_dX=0.0;
modelStruct.modelPar_given_iqr=mod.given("iqr");
modelStruct.modelPar_iqfh=mod.iqfh;
modelStruct.d_modelPar_iqfh_dX=0.0;
modelStruct.modelPar_given_iqfh=mod.given("iqfh");
modelStruct.modelPar_tfh=mod.tfh;
modelStruct.d_modelPar_tfh_dX=0.0;
modelStruct.modelPar_given_tfh=mod.given("tfh");
modelStruct.modelPar_ahq=mod.ahq;
modelStruct.d_modelPar_ahq_dX=0.0;
modelStruct.modelPar_given_ahq=mod.given("ahq");
modelStruct.modelPar_ibes=mod.ibes;
modelStruct.d_modelPar_ibes_dX=0.0;
modelStruct.modelPar_given_ibes=mod.given("ibes");
modelStruct.modelPar_mbe=mod.mbe;
modelStruct.d_modelPar_mbe_dX=0.0;
modelStruct.modelPar_given_mbe=mod.given("mbe");
modelStruct.modelPar_ires=mod.ires;
modelStruct.d_modelPar_ires_dX=0.0;
modelStruct.modelPar_given_ires=mod.given("ires");
modelStruct.modelPar_mre=mod.mre;
modelStruct.d_modelPar_mre_dX=0.0;
modelStruct.modelPar_given_mre=mod.given("mre");
modelStruct.modelPar_ibcs=mod.ibcs;
modelStruct.d_modelPar_ibcs_dX=0.0;
modelStruct.modelPar_given_ibcs=mod.given("ibcs");
modelStruct.modelPar_mbc=mod.mbc;
modelStruct.d_modelPar_mbc_dX=0.0;
modelStruct.modelPar_given_mbc=mod.given("mbc");
modelStruct.modelPar_cje0=mod.cje0;
modelStruct.d_modelPar_cje0_dX=0.0;
modelStruct.modelPar_given_cje0=mod.given("cje0");
modelStruct.modelPar_vde=mod.vde;
modelStruct.d_modelPar_vde_dX=0.0;
modelStruct.modelPar_given_vde=mod.given("vde");
modelStruct.modelPar_ze=mod.ze;
modelStruct.d_modelPar_ze_dX=0.0;
modelStruct.modelPar_given_ze=mod.given("ze");
modelStruct.modelPar_aje=mod.aje;
modelStruct.d_modelPar_aje_dX=0.0;
modelStruct.modelPar_given_aje=mod.given("aje");
modelStruct.modelPar_vdedc=mod.vdedc;
modelStruct.d_modelPar_vdedc_dX=0.0;
modelStruct.modelPar_given_vdedc=mod.given("vdedc");
modelStruct.modelPar_zedc=mod.zedc;
modelStruct.d_modelPar_zedc_dX=0.0;
modelStruct.modelPar_given_zedc=mod.given("zedc");
modelStruct.modelPar_ajedc=mod.ajedc;
modelStruct.d_modelPar_ajedc_dX=0.0;
modelStruct.modelPar_given_ajedc=mod.given("ajedc");
modelStruct.modelPar_t0=mod.t0;
modelStruct.d_modelPar_t0_dX=0.0;
modelStruct.modelPar_given_t0=mod.given("t0");
modelStruct.modelPar_dt0h=mod.dt0h;
modelStruct.d_modelPar_dt0h_dX=0.0;
modelStruct.modelPar_given_dt0h=mod.given("dt0h");
modelStruct.modelPar_tbvl=mod.tbvl;
modelStruct.d_modelPar_tbvl_dX=0.0;
modelStruct.modelPar_given_tbvl=mod.given("tbvl");
modelStruct.modelPar_tef0=mod.tef0;
modelStruct.d_modelPar_tef0_dX=0.0;
modelStruct.modelPar_given_tef0=mod.given("tef0");
modelStruct.modelPar_gte=mod.gte;
modelStruct.d_modelPar_gte_dX=0.0;
modelStruct.modelPar_given_gte=mod.given("gte");
modelStruct.modelPar_thcs=mod.thcs;
modelStruct.d_modelPar_thcs_dX=0.0;
modelStruct.modelPar_given_thcs=mod.given("thcs");
modelStruct.modelPar_ahc=mod.ahc;
modelStruct.d_modelPar_ahc_dX=0.0;
modelStruct.modelPar_given_ahc=mod.given("ahc");
modelStruct.modelPar_tr=mod.tr;
modelStruct.d_modelPar_tr_dX=0.0;
modelStruct.modelPar_given_tr=mod.given("tr");
modelStruct.modelPar_rci0=mod.rci0;
modelStruct.d_modelPar_rci0_dX=0.0;
modelStruct.modelPar_given_rci0=mod.given("rci0");
modelStruct.modelPar_vlim=mod.vlim;
modelStruct.d_modelPar_vlim_dX=0.0;
modelStruct.modelPar_given_vlim=mod.given("vlim");
modelStruct.modelPar_vpt=mod.vpt;
modelStruct.d_modelPar_vpt_dX=0.0;
modelStruct.modelPar_given_vpt=mod.given("vpt");
modelStruct.modelPar_vces=mod.vces;
modelStruct.d_modelPar_vces_dX=0.0;
modelStruct.modelPar_given_vces=mod.given("vces");
modelStruct.modelPar_cjci0=mod.cjci0;
modelStruct.d_modelPar_cjci0_dX=0.0;
modelStruct.modelPar_given_cjci0=mod.given("cjci0");
modelStruct.modelPar_vdci=mod.vdci;
modelStruct.d_modelPar_vdci_dX=0.0;
modelStruct.modelPar_given_vdci=mod.given("vdci");
modelStruct.modelPar_zci=mod.zci;
modelStruct.d_modelPar_zci_dX=0.0;
modelStruct.modelPar_given_zci=mod.given("zci");
modelStruct.modelPar_vptci=mod.vptci;
modelStruct.d_modelPar_vptci_dX=0.0;
modelStruct.modelPar_given_vptci=mod.given("vptci");
modelStruct.modelPar_cjcx0=mod.cjcx0;
modelStruct.d_modelPar_cjcx0_dX=0.0;
modelStruct.modelPar_given_cjcx0=mod.given("cjcx0");
modelStruct.modelPar_vdcx=mod.vdcx;
modelStruct.d_modelPar_vdcx_dX=0.0;
modelStruct.modelPar_given_vdcx=mod.given("vdcx");
modelStruct.modelPar_zcx=mod.zcx;
modelStruct.d_modelPar_zcx_dX=0.0;
modelStruct.modelPar_given_zcx=mod.given("zcx");
modelStruct.modelPar_vptcx=mod.vptcx;
modelStruct.d_modelPar_vptcx_dX=0.0;
modelStruct.modelPar_given_vptcx=mod.given("vptcx");
modelStruct.modelPar_fbc=mod.fbc;
modelStruct.d_modelPar_fbc_dX=0.0;
modelStruct.modelPar_given_fbc=mod.given("fbc");
modelStruct.modelPar_rbi0=mod.rbi0;
modelStruct.d_modelPar_rbi0_dX=0.0;
modelStruct.modelPar_given_rbi0=mod.given("rbi0");
modelStruct.modelPar_vr0e=mod.vr0e;
modelStruct.d_modelPar_vr0e_dX=0.0;
modelStruct.modelPar_given_vr0e=mod.given("vr0e");
modelStruct.modelPar_vr0c=mod.vr0c;
modelStruct.d_modelPar_vr0c_dX=0.0;
modelStruct.modelPar_given_vr0c=mod.given("vr0c");
modelStruct.modelPar_fgeo=mod.fgeo;
modelStruct.d_modelPar_fgeo_dX=0.0;
modelStruct.modelPar_given_fgeo=mod.given("fgeo");
modelStruct.modelPar_rbx=mod.rbx;
modelStruct.d_modelPar_rbx_dX=0.0;
modelStruct.modelPar_given_rbx=mod.given("rbx");
modelStruct.modelPar_rcx=mod.rcx;
modelStruct.d_modelPar_rcx_dX=0.0;
modelStruct.modelPar_given_rcx=mod.given("rcx");
modelStruct.modelPar_re=mod.re;
modelStruct.d_modelPar_re_dX=0.0;
modelStruct.modelPar_given_re=mod.given("re");
modelStruct.modelPar_itss=mod.itss;
modelStruct.d_modelPar_itss_dX=0.0;
modelStruct.modelPar_given_itss=mod.given("itss");
modelStruct.modelPar_msf=mod.msf;
modelStruct.d_modelPar_msf_dX=0.0;
modelStruct.modelPar_given_msf=mod.given("msf");
modelStruct.modelPar_iscs=mod.iscs;
modelStruct.d_modelPar_iscs_dX=0.0;
modelStruct.modelPar_given_iscs=mod.given("iscs");
modelStruct.modelPar_msc=mod.msc;
modelStruct.d_modelPar_msc_dX=0.0;
modelStruct.modelPar_given_msc=mod.given("msc");
modelStruct.modelPar_cjs0=mod.cjs0;
modelStruct.d_modelPar_cjs0_dX=0.0;
modelStruct.modelPar_given_cjs0=mod.given("cjs0");
modelStruct.modelPar_vds=mod.vds;
modelStruct.d_modelPar_vds_dX=0.0;
modelStruct.modelPar_given_vds=mod.given("vds");
modelStruct.modelPar_zs=mod.zs;
modelStruct.d_modelPar_zs_dX=0.0;
modelStruct.modelPar_given_zs=mod.given("zs");
modelStruct.modelPar_vpts=mod.vpts;
modelStruct.d_modelPar_vpts_dX=0.0;
modelStruct.modelPar_given_vpts=mod.given("vpts");
modelStruct.modelPar_cbcpar=mod.cbcpar;
modelStruct.d_modelPar_cbcpar_dX=0.0;
modelStruct.modelPar_given_cbcpar=mod.given("cbcpar");
modelStruct.modelPar_cbepar=mod.cbepar;
modelStruct.d_modelPar_cbepar_dX=0.0;
modelStruct.modelPar_given_cbepar=mod.given("cbepar");
modelStruct.modelPar_eavl=mod.eavl;
modelStruct.d_modelPar_eavl_dX=0.0;
modelStruct.modelPar_given_eavl=mod.given("eavl");
modelStruct.modelPar_kavl=mod.kavl;
modelStruct.d_modelPar_kavl_dX=0.0;
modelStruct.modelPar_given_kavl=mod.given("kavl");
modelStruct.modelPar_kf=mod.kf;
modelStruct.d_modelPar_kf_dX=0.0;
modelStruct.modelPar_given_kf=mod.given("kf");
modelStruct.modelPar_af=mod.af;
modelStruct.d_modelPar_af_dX=0.0;
modelStruct.modelPar_given_af=mod.given("af");
modelStruct.modelPar_alqf=mod.alqf;
modelStruct.d_modelPar_alqf_dX=0.0;
modelStruct.modelPar_given_alqf=mod.given("alqf");
modelStruct.modelPar_alit=mod.alit;
modelStruct.d_modelPar_alit_dX=0.0;
modelStruct.modelPar_given_alit=mod.given("alit");
modelStruct.modelPar_vgb=mod.vgb;
modelStruct.d_modelPar_vgb_dX=0.0;
modelStruct.modelPar_given_vgb=mod.given("vgb");
modelStruct.modelPar_vge=mod.vge;
modelStruct.d_modelPar_vge_dX=0.0;
modelStruct.modelPar_given_vge=mod.given("vge");
modelStruct.modelPar_vgc=mod.vgc;
modelStruct.d_modelPar_vgc_dX=0.0;
modelStruct.modelPar_given_vgc=mod.given("vgc");
modelStruct.modelPar_vgs=mod.vgs;
modelStruct.d_modelPar_vgs_dX=0.0;
modelStruct.modelPar_given_vgs=mod.given("vgs");
modelStruct.modelPar_f1vg=mod.f1vg;
modelStruct.d_modelPar_f1vg_dX=0.0;
modelStruct.modelPar_given_f1vg=mod.given("f1vg");
modelStruct.modelPar_f2vg=mod.f2vg;
modelStruct.d_modelPar_f2vg_dX=0.0;
modelStruct.modelPar_given_f2vg=mod.given("f2vg");
modelStruct.modelPar_alt0=mod.alt0;
modelStruct.d_modelPar_alt0_dX=0.0;
modelStruct.modelPar_given_alt0=mod.given("alt0");
modelStruct.modelPar_kt0=mod.kt0;
modelStruct.d_modelPar_kt0_dX=0.0;
modelStruct.modelPar_given_kt0=mod.given("kt0");
modelStruct.modelPar_zetact=mod.zetact;
modelStruct.d_modelPar_zetact_dX=0.0;
modelStruct.modelPar_given_zetact=mod.given("zetact");
modelStruct.modelPar_zetabet=mod.zetabet;
modelStruct.d_modelPar_zetabet_dX=0.0;
modelStruct.modelPar_given_zetabet=mod.given("zetabet");
modelStruct.modelPar_zetaci=mod.zetaci;
modelStruct.d_modelPar_zetaci_dX=0.0;
modelStruct.modelPar_given_zetaci=mod.given("zetaci");
modelStruct.modelPar_alvs=mod.alvs;
modelStruct.d_modelPar_alvs_dX=0.0;
modelStruct.modelPar_given_alvs=mod.given("alvs");
modelStruct.modelPar_alces=mod.alces;
modelStruct.d_modelPar_alces_dX=0.0;
modelStruct.modelPar_given_alces=mod.given("alces");
modelStruct.modelPar_zetarbi=mod.zetarbi;
modelStruct.d_modelPar_zetarbi_dX=0.0;
modelStruct.modelPar_given_zetarbi=mod.given("zetarbi");
modelStruct.modelPar_zetarbx=mod.zetarbx;
modelStruct.d_modelPar_zetarbx_dX=0.0;
modelStruct.modelPar_given_zetarbx=mod.given("zetarbx");
modelStruct.modelPar_zetarcx=mod.zetarcx;
modelStruct.d_modelPar_zetarcx_dX=0.0;
modelStruct.modelPar_given_zetarcx=mod.given("zetarcx");
modelStruct.modelPar_zetare=mod.zetare;
modelStruct.d_modelPar_zetare_dX=0.0;
modelStruct.modelPar_given_zetare=mod.given("zetare");
modelStruct.modelPar_zetaiqf=mod.zetaiqf;
modelStruct.d_modelPar_zetaiqf_dX=0.0;
modelStruct.modelPar_given_zetaiqf=mod.given("zetaiqf");
modelStruct.modelPar_alkav=mod.alkav;
modelStruct.d_modelPar_alkav_dX=0.0;
modelStruct.modelPar_given_alkav=mod.given("alkav");
modelStruct.modelPar_aleav=mod.aleav;
modelStruct.d_modelPar_aleav_dX=0.0;
modelStruct.modelPar_given_aleav=mod.given("aleav");
modelStruct.modelPar_zetarth=mod.zetarth;
modelStruct.d_modelPar_zetarth_dX=0.0;
modelStruct.modelPar_given_zetarth=mod.given("zetarth");
modelStruct.modelPar_zetaver=mod.zetaver;
modelStruct.d_modelPar_zetaver_dX=0.0;
modelStruct.modelPar_given_zetaver=mod.given("zetaver");
modelStruct.modelPar_zetavgbe=mod.zetavgbe;
modelStruct.d_modelPar_zetavgbe_dX=0.0;
modelStruct.modelPar_given_zetavgbe=mod.given("zetavgbe");
modelStruct.modelPar_dvgbe=mod.dvgbe;
modelStruct.d_modelPar_dvgbe_dX=0.0;
modelStruct.modelPar_given_dvgbe=mod.given("dvgbe");
modelStruct.modelPar_aliqfh=mod.aliqfh;
modelStruct.d_modelPar_aliqfh_dX=0.0;
modelStruct.modelPar_given_aliqfh=mod.given("aliqfh");
modelStruct.modelPar_kiqfh=mod.kiqfh;
modelStruct.d_modelPar_kiqfh_dX=0.0;
modelStruct.modelPar_given_kiqfh=mod.given("kiqfh");
modelStruct.modelPar_rth=mod.rth;
modelStruct.d_modelPar_rth_dX=0.0;
modelStruct.modelPar_given_rth=mod.given("rth");
modelStruct.modelPar_cth=mod.cth;
modelStruct.d_modelPar_cth_dX=0.0;
modelStruct.modelPar_given_cth=mod.given("cth");
modelStruct.modelPar_tnom=mod.tnom;
modelStruct.d_modelPar_tnom_dX=0.0;
modelStruct.modelPar_given_tnom=mod.given("tnom");


// hidden reals


// non-reals (including hiddens)
modelStruct.modelPar_it_mod=mod.it_mod;
modelStruct.modelPar_given_it_mod=mod.given("it_mod");
modelStruct.modelPar_flnqs=mod.flnqs;
modelStruct.modelPar_given_flnqs=mod.given("flnqs");
modelStruct.modelPar_tef_temp=mod.tef_temp;
modelStruct.modelPar_given_tef_temp=mod.given("tef_temp");
modelStruct.modelPar_flsh=mod.flsh;
modelStruct.modelPar_given_flsh=mod.given("flsh");
modelStruct.modelPar_type=mod.type;
modelStruct.modelPar_given_type=mod.given("type");



// Copy out all the instance parameters (doubles) into local struct
// Keep a map so we can set the right one to the independent variable
// We do this solely to avoid a big ugly "if/else" block just to find the
// one parameter we're doing sensitivities on.
unordered_map <std::string,double*,HashNoCase,EqualNoCase> inParamMap;
instanceSensStruct instanceStruct;
// reals
instanceStruct.instancePar_dt=in.dt;
instanceStruct.d_instancePar_dt_dX=0.0;
instanceStruct.instancePar_given_dt=in.given("dt");
inParamMap["dt"] = &(instanceStruct.d_instancePar_dt_dX);


// Copy all the real hidden instance params into local struct



// Copy all the non-real instance params into vars of their appropriate type:


// Set the one parameter whose name was passed in to be the independent
// variable for differentiation purposes.  Since we stored variable pointers, this
// makes sure that that ONE variable gets set right.
// FIXME: make this check the name first, otherwise segfault on invalid name!
*(inParamMap[name])=1.0;

//make local copies of all instance vars
//reals
instanceStruct.instanceVar_qjci=in.qjci;
instanceStruct.d_instanceVar_qjci_dX=0.0;
instanceStruct.instanceVar_qjei=in.qjei;
instanceStruct.d_instanceVar_qjei_dX=0.0;
instanceStruct.instanceVar_it=in.it;
instanceStruct.d_instanceVar_it_dX=0.0;
instanceStruct.instanceVar_ijbc=in.ijbc;
instanceStruct.d_instanceVar_ijbc_dX=0.0;
instanceStruct.instanceVar_iavl=in.iavl;
instanceStruct.d_instanceVar_iavl_dX=0.0;
instanceStruct.instanceVar_ijsc=in.ijsc;
instanceStruct.d_instanceVar_ijsc_dX=0.0;
instanceStruct.instanceVar_Ibici=in.Ibici;
instanceStruct.d_instanceVar_Ibici_dX=0.0;
instanceStruct.instanceVar_ijbe=in.ijbe;
instanceStruct.d_instanceVar_ijbe_dX=0.0;


//non-reals


//make local copies of all model vars
//reals


// non-reals



Linear::Vector * solVectorPtr = in.extData.nextSolVectorPtr;

// extract solution variables
probeVars[in.admsProbeID_V_s_GND] = (*solVectorPtr)[in.li_s];
probeVars[in.admsProbeID_V_ei_GND] = (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_ci_GND] = (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_bi_GND] = (*solVectorPtr)[in.li_bi];
probeVars[in.admsProbeID_V_s_c] = (*solVectorPtr)[in.li_s]- (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_c_e] = (*solVectorPtr)[in.li_c]- (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_b_c] = (*solVectorPtr)[in.li_b]- (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_xf_GND] = (*solVectorPtr)[in.li_xf];
probeVars[in.admsProbeID_V_xf2_GND] = (*solVectorPtr)[in.li_xf2];
probeVars[in.admsProbeID_V_xf1_GND] = (*solVectorPtr)[in.li_xf1];
probeVars[in.admsProbeID_V_tnode_GND] = (*solVectorPtr)[in.li_tnode];
probeVars[in.admsProbeID_V_b_e] = (*solVectorPtr)[in.li_b]- (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_b_bi] = (*solVectorPtr)[in.li_b]- (*solVectorPtr)[in.li_bi];
probeVars[in.admsProbeID_V_ci_c] = (*solVectorPtr)[in.li_ci]- (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_ei_e] = (*solVectorPtr)[in.li_ei]- (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_s_ci] = (*solVectorPtr)[in.li_s]- (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_ci_ei] = (*solVectorPtr)[in.li_ci]- (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_bi_ei] = (*solVectorPtr)[in.li_bi]- (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_bi_ci] = (*solVectorPtr)[in.li_bi]- (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_b_ci] = (*solVectorPtr)[in.li_b]- (*solVectorPtr)[in.li_ci];




// Now call  the function that does the heavy lifting.
evaluateModelEquations(
probeVars,
// probe constants
in.admsProbeID_V_s_GND,
in.admsProbeID_V_ei_GND,
in.admsProbeID_V_ci_GND,
in.admsProbeID_V_bi_GND,
in.admsProbeID_V_s_c,
in.admsProbeID_V_c_e,
in.admsProbeID_V_b_c,
in.admsProbeID_V_xf_GND,
in.admsProbeID_V_xf2_GND,
in.admsProbeID_V_xf1_GND,
in.admsProbeID_V_tnode_GND,
in.admsProbeID_V_b_e,
in.admsProbeID_V_b_bi,
in.admsProbeID_V_ci_c,
in.admsProbeID_V_ei_e,
in.admsProbeID_V_s_ci,
in.admsProbeID_V_ci_ei,
in.admsProbeID_V_bi_ei,
in.admsProbeID_V_bi_ci,
in.admsProbeID_V_b_ci,

// node constants
in.admsNodeID_c,
in.admsNodeID_b,
in.admsNodeID_e,
in.admsNodeID_s,
in.admsNodeID_tnode,
in.admsNodeID_ci,
in.admsNodeID_bi,
in.admsNodeID_ei,
in.admsNodeID_xf1,
in.admsNodeID_xf2,
in.admsNodeID_xf,
instanceStruct,
modelStruct,
 in.admsTemperature,
 in.adms_vt_nom,
 in.getDeviceOptions().gmin,
 d_staticContributions_dX,
 d_dynamicContributions_dX,
 in);


// We now have the F and Q vector stuff, populate the dependencies:

    dfdp[in.admsNodeID_c] += d_staticContributions_dX[in.admsNodeID_c];
    dqdp[in.admsNodeID_c] += d_dynamicContributions_dX[in.admsNodeID_c];
    Findices[in.admsNodeID_c] = in.li_c;
    Qindices[in.admsNodeID_c] = in.li_c;
    dfdp[in.admsNodeID_b] += d_staticContributions_dX[in.admsNodeID_b];
    dqdp[in.admsNodeID_b] += d_dynamicContributions_dX[in.admsNodeID_b];
    Findices[in.admsNodeID_b] = in.li_b;
    Qindices[in.admsNodeID_b] = in.li_b;
    dfdp[in.admsNodeID_e] += d_staticContributions_dX[in.admsNodeID_e];
    dqdp[in.admsNodeID_e] += d_dynamicContributions_dX[in.admsNodeID_e];
    Findices[in.admsNodeID_e] = in.li_e;
    Qindices[in.admsNodeID_e] = in.li_e;
    dfdp[in.admsNodeID_s] += d_staticContributions_dX[in.admsNodeID_s];
    dqdp[in.admsNodeID_s] += d_dynamicContributions_dX[in.admsNodeID_s];
    Findices[in.admsNodeID_s] = in.li_s;
    Qindices[in.admsNodeID_s] = in.li_s;
    dfdp[in.admsNodeID_tnode] += d_staticContributions_dX[in.admsNodeID_tnode];
    dqdp[in.admsNodeID_tnode] += d_dynamicContributions_dX[in.admsNodeID_tnode];
    Findices[in.admsNodeID_tnode] = in.li_tnode;
    Qindices[in.admsNodeID_tnode] = in.li_tnode;
    dfdp[in.admsNodeID_ci] += d_staticContributions_dX[in.admsNodeID_ci];
    dqdp[in.admsNodeID_ci] += d_dynamicContributions_dX[in.admsNodeID_ci];
    Findices[in.admsNodeID_ci] = in.li_ci;
    Qindices[in.admsNodeID_ci] = in.li_ci;
    dfdp[in.admsNodeID_bi] += d_staticContributions_dX[in.admsNodeID_bi];
    dqdp[in.admsNodeID_bi] += d_dynamicContributions_dX[in.admsNodeID_bi];
    Findices[in.admsNodeID_bi] = in.li_bi;
    Qindices[in.admsNodeID_bi] = in.li_bi;
    dfdp[in.admsNodeID_ei] += d_staticContributions_dX[in.admsNodeID_ei];
    dqdp[in.admsNodeID_ei] += d_dynamicContributions_dX[in.admsNodeID_ei];
    Findices[in.admsNodeID_ei] = in.li_ei;
    Qindices[in.admsNodeID_ei] = in.li_ei;
    dfdp[in.admsNodeID_xf1] += d_staticContributions_dX[in.admsNodeID_xf1];
    dqdp[in.admsNodeID_xf1] += d_dynamicContributions_dX[in.admsNodeID_xf1];
    Findices[in.admsNodeID_xf1] = in.li_xf1;
    Qindices[in.admsNodeID_xf1] = in.li_xf1;
    dfdp[in.admsNodeID_xf2] += d_staticContributions_dX[in.admsNodeID_xf2];
    dqdp[in.admsNodeID_xf2] += d_dynamicContributions_dX[in.admsNodeID_xf2];
    Findices[in.admsNodeID_xf2] = in.li_xf2;
    Qindices[in.admsNodeID_xf2] = in.li_xf2;
    dfdp[in.admsNodeID_xf] += d_staticContributions_dX[in.admsNodeID_xf];
    dqdp[in.admsNodeID_xf] += d_dynamicContributions_dX[in.admsNodeID_xf];
    Findices[in.admsNodeID_xf] = in.li_xf;
    Qindices[in.admsNodeID_xf] = in.li_xf;


}

//-----------------------------------------------------------------------------
// Function      : ModelSensitivity::operator()
// Purpose       : return sensitivity for a single model parameter
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
/// Compute sensitivity to a specified model
/// parameter of all device instances of that model's outputs
///
///
/// @param[in] entity  The device entity that owns the parameter
/// @param[in] name    The unadorned parameter name specific to the entity
/// @param[out] dfdp   The derivative of the F vector with respect to the parameter
/// @param[out] dqdp   The derivative of the Q vector with respect to the parameter
/// @param[out] dbdp   The derivative of the B vector with respect to the parameter
/// @param[out] Findices   The indices into the F vector corresponding to the elements of dfdp
/// @param[out] Qindices   The indices into the Q vector corresponding to the elements of dfdp
/// @param[out] Bindices   The indices into the B vector corresponding to the elements of dfdp
///
///
void ModelSensitivity::operator()
(
const ParameterBase &entity,
const std::string &name,
std::vector<double> & dfdp,
std::vector<double> & dqdp,
std::vector<double> & dbdp,
std::vector<int> & Findices,
std::vector<int> & Qindices,
std::vector<int> & Bindices
) const
{
const ParameterBase * e1 = &entity;
const Model & mod = *(dynamic_cast<const Model *> (e1));
int sizeInstance = mod.instanceContainer.size();

dfdp.resize((11+0)*sizeInstance);
dqdp.resize((11+0)*sizeInstance);
Findices.resize((11+0)*sizeInstance);
Qindices.resize((11+0)*sizeInstance);

std::vector <double> probeVars(20);
std::vector <double> d_staticContributions_dX(11+0);
std::vector <double> d_dynamicContributions_dX(11+0);


// Copy out all the model parameters (doubles) into local structure
modelSensStruct modelStruct;

// Keep a map so we can set the right one to the independent variable
// We do this solely to avoid a big ugly "if/else" block just to find the
// one parameter we're doing sensitivities on.
unordered_map <std::string,double*,HashNoCase,EqualNoCase> modParamMap;

// reals
modelStruct.modelPar_is=mod.is;
modelStruct.d_modelPar_is_dX=0.0;
modelStruct.modelPar_given_is=mod.given("is");
modParamMap["is"] = &(modelStruct.d_modelPar_is_dX);
modelStruct.modelPar_mcf=mod.mcf;
modelStruct.d_modelPar_mcf_dX=0.0;
modelStruct.modelPar_given_mcf=mod.given("mcf");
modParamMap["mcf"] = &(modelStruct.d_modelPar_mcf_dX);
modelStruct.modelPar_mcr=mod.mcr;
modelStruct.d_modelPar_mcr_dX=0.0;
modelStruct.modelPar_given_mcr=mod.given("mcr");
modParamMap["mcr"] = &(modelStruct.d_modelPar_mcr_dX);
modelStruct.modelPar_vef=mod.vef;
modelStruct.d_modelPar_vef_dX=0.0;
modelStruct.modelPar_given_vef=mod.given("vef");
modParamMap["vef"] = &(modelStruct.d_modelPar_vef_dX);
modelStruct.modelPar_ver=mod.ver;
modelStruct.d_modelPar_ver_dX=0.0;
modelStruct.modelPar_given_ver=mod.given("ver");
modParamMap["ver"] = &(modelStruct.d_modelPar_ver_dX);
modelStruct.modelPar_aver=mod.aver;
modelStruct.d_modelPar_aver_dX=0.0;
modelStruct.modelPar_given_aver=mod.given("aver");
modParamMap["aver"] = &(modelStruct.d_modelPar_aver_dX);
modelStruct.modelPar_iqf=mod.iqf;
modelStruct.d_modelPar_iqf_dX=0.0;
modelStruct.modelPar_given_iqf=mod.given("iqf");
modParamMap["iqf"] = &(modelStruct.d_modelPar_iqf_dX);
modelStruct.modelPar_fiqf=mod.fiqf;
modelStruct.d_modelPar_fiqf_dX=0.0;
modelStruct.modelPar_given_fiqf=mod.given("fiqf");
modParamMap["fiqf"] = &(modelStruct.d_modelPar_fiqf_dX);
modelStruct.modelPar_iqr=mod.iqr;
modelStruct.d_modelPar_iqr_dX=0.0;
modelStruct.modelPar_given_iqr=mod.given("iqr");
modParamMap["iqr"] = &(modelStruct.d_modelPar_iqr_dX);
modelStruct.modelPar_iqfh=mod.iqfh;
modelStruct.d_modelPar_iqfh_dX=0.0;
modelStruct.modelPar_given_iqfh=mod.given("iqfh");
modParamMap["iqfh"] = &(modelStruct.d_modelPar_iqfh_dX);
modelStruct.modelPar_tfh=mod.tfh;
modelStruct.d_modelPar_tfh_dX=0.0;
modelStruct.modelPar_given_tfh=mod.given("tfh");
modParamMap["tfh"] = &(modelStruct.d_modelPar_tfh_dX);
modelStruct.modelPar_ahq=mod.ahq;
modelStruct.d_modelPar_ahq_dX=0.0;
modelStruct.modelPar_given_ahq=mod.given("ahq");
modParamMap["ahq"] = &(modelStruct.d_modelPar_ahq_dX);
modelStruct.modelPar_ibes=mod.ibes;
modelStruct.d_modelPar_ibes_dX=0.0;
modelStruct.modelPar_given_ibes=mod.given("ibes");
modParamMap["ibes"] = &(modelStruct.d_modelPar_ibes_dX);
modelStruct.modelPar_mbe=mod.mbe;
modelStruct.d_modelPar_mbe_dX=0.0;
modelStruct.modelPar_given_mbe=mod.given("mbe");
modParamMap["mbe"] = &(modelStruct.d_modelPar_mbe_dX);
modelStruct.modelPar_ires=mod.ires;
modelStruct.d_modelPar_ires_dX=0.0;
modelStruct.modelPar_given_ires=mod.given("ires");
modParamMap["ires"] = &(modelStruct.d_modelPar_ires_dX);
modelStruct.modelPar_mre=mod.mre;
modelStruct.d_modelPar_mre_dX=0.0;
modelStruct.modelPar_given_mre=mod.given("mre");
modParamMap["mre"] = &(modelStruct.d_modelPar_mre_dX);
modelStruct.modelPar_ibcs=mod.ibcs;
modelStruct.d_modelPar_ibcs_dX=0.0;
modelStruct.modelPar_given_ibcs=mod.given("ibcs");
modParamMap["ibcs"] = &(modelStruct.d_modelPar_ibcs_dX);
modelStruct.modelPar_mbc=mod.mbc;
modelStruct.d_modelPar_mbc_dX=0.0;
modelStruct.modelPar_given_mbc=mod.given("mbc");
modParamMap["mbc"] = &(modelStruct.d_modelPar_mbc_dX);
modelStruct.modelPar_cje0=mod.cje0;
modelStruct.d_modelPar_cje0_dX=0.0;
modelStruct.modelPar_given_cje0=mod.given("cje0");
modParamMap["cje0"] = &(modelStruct.d_modelPar_cje0_dX);
modelStruct.modelPar_vde=mod.vde;
modelStruct.d_modelPar_vde_dX=0.0;
modelStruct.modelPar_given_vde=mod.given("vde");
modParamMap["vde"] = &(modelStruct.d_modelPar_vde_dX);
modelStruct.modelPar_ze=mod.ze;
modelStruct.d_modelPar_ze_dX=0.0;
modelStruct.modelPar_given_ze=mod.given("ze");
modParamMap["ze"] = &(modelStruct.d_modelPar_ze_dX);
modelStruct.modelPar_aje=mod.aje;
modelStruct.d_modelPar_aje_dX=0.0;
modelStruct.modelPar_given_aje=mod.given("aje");
modParamMap["aje"] = &(modelStruct.d_modelPar_aje_dX);
modelStruct.modelPar_vdedc=mod.vdedc;
modelStruct.d_modelPar_vdedc_dX=0.0;
modelStruct.modelPar_given_vdedc=mod.given("vdedc");
modParamMap["vdedc"] = &(modelStruct.d_modelPar_vdedc_dX);
modelStruct.modelPar_zedc=mod.zedc;
modelStruct.d_modelPar_zedc_dX=0.0;
modelStruct.modelPar_given_zedc=mod.given("zedc");
modParamMap["zedc"] = &(modelStruct.d_modelPar_zedc_dX);
modelStruct.modelPar_ajedc=mod.ajedc;
modelStruct.d_modelPar_ajedc_dX=0.0;
modelStruct.modelPar_given_ajedc=mod.given("ajedc");
modParamMap["ajedc"] = &(modelStruct.d_modelPar_ajedc_dX);
modelStruct.modelPar_t0=mod.t0;
modelStruct.d_modelPar_t0_dX=0.0;
modelStruct.modelPar_given_t0=mod.given("t0");
modParamMap["t0"] = &(modelStruct.d_modelPar_t0_dX);
modelStruct.modelPar_dt0h=mod.dt0h;
modelStruct.d_modelPar_dt0h_dX=0.0;
modelStruct.modelPar_given_dt0h=mod.given("dt0h");
modParamMap["dt0h"] = &(modelStruct.d_modelPar_dt0h_dX);
modelStruct.modelPar_tbvl=mod.tbvl;
modelStruct.d_modelPar_tbvl_dX=0.0;
modelStruct.modelPar_given_tbvl=mod.given("tbvl");
modParamMap["tbvl"] = &(modelStruct.d_modelPar_tbvl_dX);
modelStruct.modelPar_tef0=mod.tef0;
modelStruct.d_modelPar_tef0_dX=0.0;
modelStruct.modelPar_given_tef0=mod.given("tef0");
modParamMap["tef0"] = &(modelStruct.d_modelPar_tef0_dX);
modelStruct.modelPar_gte=mod.gte;
modelStruct.d_modelPar_gte_dX=0.0;
modelStruct.modelPar_given_gte=mod.given("gte");
modParamMap["gte"] = &(modelStruct.d_modelPar_gte_dX);
modelStruct.modelPar_thcs=mod.thcs;
modelStruct.d_modelPar_thcs_dX=0.0;
modelStruct.modelPar_given_thcs=mod.given("thcs");
modParamMap["thcs"] = &(modelStruct.d_modelPar_thcs_dX);
modelStruct.modelPar_ahc=mod.ahc;
modelStruct.d_modelPar_ahc_dX=0.0;
modelStruct.modelPar_given_ahc=mod.given("ahc");
modParamMap["ahc"] = &(modelStruct.d_modelPar_ahc_dX);
modelStruct.modelPar_tr=mod.tr;
modelStruct.d_modelPar_tr_dX=0.0;
modelStruct.modelPar_given_tr=mod.given("tr");
modParamMap["tr"] = &(modelStruct.d_modelPar_tr_dX);
modelStruct.modelPar_rci0=mod.rci0;
modelStruct.d_modelPar_rci0_dX=0.0;
modelStruct.modelPar_given_rci0=mod.given("rci0");
modParamMap["rci0"] = &(modelStruct.d_modelPar_rci0_dX);
modelStruct.modelPar_vlim=mod.vlim;
modelStruct.d_modelPar_vlim_dX=0.0;
modelStruct.modelPar_given_vlim=mod.given("vlim");
modParamMap["vlim"] = &(modelStruct.d_modelPar_vlim_dX);
modelStruct.modelPar_vpt=mod.vpt;
modelStruct.d_modelPar_vpt_dX=0.0;
modelStruct.modelPar_given_vpt=mod.given("vpt");
modParamMap["vpt"] = &(modelStruct.d_modelPar_vpt_dX);
modelStruct.modelPar_vces=mod.vces;
modelStruct.d_modelPar_vces_dX=0.0;
modelStruct.modelPar_given_vces=mod.given("vces");
modParamMap["vces"] = &(modelStruct.d_modelPar_vces_dX);
modelStruct.modelPar_cjci0=mod.cjci0;
modelStruct.d_modelPar_cjci0_dX=0.0;
modelStruct.modelPar_given_cjci0=mod.given("cjci0");
modParamMap["cjci0"] = &(modelStruct.d_modelPar_cjci0_dX);
modelStruct.modelPar_vdci=mod.vdci;
modelStruct.d_modelPar_vdci_dX=0.0;
modelStruct.modelPar_given_vdci=mod.given("vdci");
modParamMap["vdci"] = &(modelStruct.d_modelPar_vdci_dX);
modelStruct.modelPar_zci=mod.zci;
modelStruct.d_modelPar_zci_dX=0.0;
modelStruct.modelPar_given_zci=mod.given("zci");
modParamMap["zci"] = &(modelStruct.d_modelPar_zci_dX);
modelStruct.modelPar_vptci=mod.vptci;
modelStruct.d_modelPar_vptci_dX=0.0;
modelStruct.modelPar_given_vptci=mod.given("vptci");
modParamMap["vptci"] = &(modelStruct.d_modelPar_vptci_dX);
modelStruct.modelPar_cjcx0=mod.cjcx0;
modelStruct.d_modelPar_cjcx0_dX=0.0;
modelStruct.modelPar_given_cjcx0=mod.given("cjcx0");
modParamMap["cjcx0"] = &(modelStruct.d_modelPar_cjcx0_dX);
modelStruct.modelPar_vdcx=mod.vdcx;
modelStruct.d_modelPar_vdcx_dX=0.0;
modelStruct.modelPar_given_vdcx=mod.given("vdcx");
modParamMap["vdcx"] = &(modelStruct.d_modelPar_vdcx_dX);
modelStruct.modelPar_zcx=mod.zcx;
modelStruct.d_modelPar_zcx_dX=0.0;
modelStruct.modelPar_given_zcx=mod.given("zcx");
modParamMap["zcx"] = &(modelStruct.d_modelPar_zcx_dX);
modelStruct.modelPar_vptcx=mod.vptcx;
modelStruct.d_modelPar_vptcx_dX=0.0;
modelStruct.modelPar_given_vptcx=mod.given("vptcx");
modParamMap["vptcx"] = &(modelStruct.d_modelPar_vptcx_dX);
modelStruct.modelPar_fbc=mod.fbc;
modelStruct.d_modelPar_fbc_dX=0.0;
modelStruct.modelPar_given_fbc=mod.given("fbc");
modParamMap["fbc"] = &(modelStruct.d_modelPar_fbc_dX);
modelStruct.modelPar_rbi0=mod.rbi0;
modelStruct.d_modelPar_rbi0_dX=0.0;
modelStruct.modelPar_given_rbi0=mod.given("rbi0");
modParamMap["rbi0"] = &(modelStruct.d_modelPar_rbi0_dX);
modelStruct.modelPar_vr0e=mod.vr0e;
modelStruct.d_modelPar_vr0e_dX=0.0;
modelStruct.modelPar_given_vr0e=mod.given("vr0e");
modParamMap["vr0e"] = &(modelStruct.d_modelPar_vr0e_dX);
modelStruct.modelPar_vr0c=mod.vr0c;
modelStruct.d_modelPar_vr0c_dX=0.0;
modelStruct.modelPar_given_vr0c=mod.given("vr0c");
modParamMap["vr0c"] = &(modelStruct.d_modelPar_vr0c_dX);
modelStruct.modelPar_fgeo=mod.fgeo;
modelStruct.d_modelPar_fgeo_dX=0.0;
modelStruct.modelPar_given_fgeo=mod.given("fgeo");
modParamMap["fgeo"] = &(modelStruct.d_modelPar_fgeo_dX);
modelStruct.modelPar_rbx=mod.rbx;
modelStruct.d_modelPar_rbx_dX=0.0;
modelStruct.modelPar_given_rbx=mod.given("rbx");
modParamMap["rbx"] = &(modelStruct.d_modelPar_rbx_dX);
modelStruct.modelPar_rcx=mod.rcx;
modelStruct.d_modelPar_rcx_dX=0.0;
modelStruct.modelPar_given_rcx=mod.given("rcx");
modParamMap["rcx"] = &(modelStruct.d_modelPar_rcx_dX);
modelStruct.modelPar_re=mod.re;
modelStruct.d_modelPar_re_dX=0.0;
modelStruct.modelPar_given_re=mod.given("re");
modParamMap["re"] = &(modelStruct.d_modelPar_re_dX);
modelStruct.modelPar_itss=mod.itss;
modelStruct.d_modelPar_itss_dX=0.0;
modelStruct.modelPar_given_itss=mod.given("itss");
modParamMap["itss"] = &(modelStruct.d_modelPar_itss_dX);
modelStruct.modelPar_msf=mod.msf;
modelStruct.d_modelPar_msf_dX=0.0;
modelStruct.modelPar_given_msf=mod.given("msf");
modParamMap["msf"] = &(modelStruct.d_modelPar_msf_dX);
modelStruct.modelPar_iscs=mod.iscs;
modelStruct.d_modelPar_iscs_dX=0.0;
modelStruct.modelPar_given_iscs=mod.given("iscs");
modParamMap["iscs"] = &(modelStruct.d_modelPar_iscs_dX);
modelStruct.modelPar_msc=mod.msc;
modelStruct.d_modelPar_msc_dX=0.0;
modelStruct.modelPar_given_msc=mod.given("msc");
modParamMap["msc"] = &(modelStruct.d_modelPar_msc_dX);
modelStruct.modelPar_cjs0=mod.cjs0;
modelStruct.d_modelPar_cjs0_dX=0.0;
modelStruct.modelPar_given_cjs0=mod.given("cjs0");
modParamMap["cjs0"] = &(modelStruct.d_modelPar_cjs0_dX);
modelStruct.modelPar_vds=mod.vds;
modelStruct.d_modelPar_vds_dX=0.0;
modelStruct.modelPar_given_vds=mod.given("vds");
modParamMap["vds"] = &(modelStruct.d_modelPar_vds_dX);
modelStruct.modelPar_zs=mod.zs;
modelStruct.d_modelPar_zs_dX=0.0;
modelStruct.modelPar_given_zs=mod.given("zs");
modParamMap["zs"] = &(modelStruct.d_modelPar_zs_dX);
modelStruct.modelPar_vpts=mod.vpts;
modelStruct.d_modelPar_vpts_dX=0.0;
modelStruct.modelPar_given_vpts=mod.given("vpts");
modParamMap["vpts"] = &(modelStruct.d_modelPar_vpts_dX);
modelStruct.modelPar_cbcpar=mod.cbcpar;
modelStruct.d_modelPar_cbcpar_dX=0.0;
modelStruct.modelPar_given_cbcpar=mod.given("cbcpar");
modParamMap["cbcpar"] = &(modelStruct.d_modelPar_cbcpar_dX);
modelStruct.modelPar_cbepar=mod.cbepar;
modelStruct.d_modelPar_cbepar_dX=0.0;
modelStruct.modelPar_given_cbepar=mod.given("cbepar");
modParamMap["cbepar"] = &(modelStruct.d_modelPar_cbepar_dX);
modelStruct.modelPar_eavl=mod.eavl;
modelStruct.d_modelPar_eavl_dX=0.0;
modelStruct.modelPar_given_eavl=mod.given("eavl");
modParamMap["eavl"] = &(modelStruct.d_modelPar_eavl_dX);
modelStruct.modelPar_kavl=mod.kavl;
modelStruct.d_modelPar_kavl_dX=0.0;
modelStruct.modelPar_given_kavl=mod.given("kavl");
modParamMap["kavl"] = &(modelStruct.d_modelPar_kavl_dX);
modelStruct.modelPar_kf=mod.kf;
modelStruct.d_modelPar_kf_dX=0.0;
modelStruct.modelPar_given_kf=mod.given("kf");
modParamMap["kf"] = &(modelStruct.d_modelPar_kf_dX);
modelStruct.modelPar_af=mod.af;
modelStruct.d_modelPar_af_dX=0.0;
modelStruct.modelPar_given_af=mod.given("af");
modParamMap["af"] = &(modelStruct.d_modelPar_af_dX);
modelStruct.modelPar_alqf=mod.alqf;
modelStruct.d_modelPar_alqf_dX=0.0;
modelStruct.modelPar_given_alqf=mod.given("alqf");
modParamMap["alqf"] = &(modelStruct.d_modelPar_alqf_dX);
modelStruct.modelPar_alit=mod.alit;
modelStruct.d_modelPar_alit_dX=0.0;
modelStruct.modelPar_given_alit=mod.given("alit");
modParamMap["alit"] = &(modelStruct.d_modelPar_alit_dX);
modelStruct.modelPar_vgb=mod.vgb;
modelStruct.d_modelPar_vgb_dX=0.0;
modelStruct.modelPar_given_vgb=mod.given("vgb");
modParamMap["vgb"] = &(modelStruct.d_modelPar_vgb_dX);
modelStruct.modelPar_vge=mod.vge;
modelStruct.d_modelPar_vge_dX=0.0;
modelStruct.modelPar_given_vge=mod.given("vge");
modParamMap["vge"] = &(modelStruct.d_modelPar_vge_dX);
modelStruct.modelPar_vgc=mod.vgc;
modelStruct.d_modelPar_vgc_dX=0.0;
modelStruct.modelPar_given_vgc=mod.given("vgc");
modParamMap["vgc"] = &(modelStruct.d_modelPar_vgc_dX);
modelStruct.modelPar_vgs=mod.vgs;
modelStruct.d_modelPar_vgs_dX=0.0;
modelStruct.modelPar_given_vgs=mod.given("vgs");
modParamMap["vgs"] = &(modelStruct.d_modelPar_vgs_dX);
modelStruct.modelPar_f1vg=mod.f1vg;
modelStruct.d_modelPar_f1vg_dX=0.0;
modelStruct.modelPar_given_f1vg=mod.given("f1vg");
modParamMap["f1vg"] = &(modelStruct.d_modelPar_f1vg_dX);
modelStruct.modelPar_f2vg=mod.f2vg;
modelStruct.d_modelPar_f2vg_dX=0.0;
modelStruct.modelPar_given_f2vg=mod.given("f2vg");
modParamMap["f2vg"] = &(modelStruct.d_modelPar_f2vg_dX);
modelStruct.modelPar_alt0=mod.alt0;
modelStruct.d_modelPar_alt0_dX=0.0;
modelStruct.modelPar_given_alt0=mod.given("alt0");
modParamMap["alt0"] = &(modelStruct.d_modelPar_alt0_dX);
modelStruct.modelPar_kt0=mod.kt0;
modelStruct.d_modelPar_kt0_dX=0.0;
modelStruct.modelPar_given_kt0=mod.given("kt0");
modParamMap["kt0"] = &(modelStruct.d_modelPar_kt0_dX);
modelStruct.modelPar_zetact=mod.zetact;
modelStruct.d_modelPar_zetact_dX=0.0;
modelStruct.modelPar_given_zetact=mod.given("zetact");
modParamMap["zetact"] = &(modelStruct.d_modelPar_zetact_dX);
modelStruct.modelPar_zetabet=mod.zetabet;
modelStruct.d_modelPar_zetabet_dX=0.0;
modelStruct.modelPar_given_zetabet=mod.given("zetabet");
modParamMap["zetabet"] = &(modelStruct.d_modelPar_zetabet_dX);
modelStruct.modelPar_zetaci=mod.zetaci;
modelStruct.d_modelPar_zetaci_dX=0.0;
modelStruct.modelPar_given_zetaci=mod.given("zetaci");
modParamMap["zetaci"] = &(modelStruct.d_modelPar_zetaci_dX);
modelStruct.modelPar_alvs=mod.alvs;
modelStruct.d_modelPar_alvs_dX=0.0;
modelStruct.modelPar_given_alvs=mod.given("alvs");
modParamMap["alvs"] = &(modelStruct.d_modelPar_alvs_dX);
modelStruct.modelPar_alces=mod.alces;
modelStruct.d_modelPar_alces_dX=0.0;
modelStruct.modelPar_given_alces=mod.given("alces");
modParamMap["alces"] = &(modelStruct.d_modelPar_alces_dX);
modelStruct.modelPar_zetarbi=mod.zetarbi;
modelStruct.d_modelPar_zetarbi_dX=0.0;
modelStruct.modelPar_given_zetarbi=mod.given("zetarbi");
modParamMap["zetarbi"] = &(modelStruct.d_modelPar_zetarbi_dX);
modelStruct.modelPar_zetarbx=mod.zetarbx;
modelStruct.d_modelPar_zetarbx_dX=0.0;
modelStruct.modelPar_given_zetarbx=mod.given("zetarbx");
modParamMap["zetarbx"] = &(modelStruct.d_modelPar_zetarbx_dX);
modelStruct.modelPar_zetarcx=mod.zetarcx;
modelStruct.d_modelPar_zetarcx_dX=0.0;
modelStruct.modelPar_given_zetarcx=mod.given("zetarcx");
modParamMap["zetarcx"] = &(modelStruct.d_modelPar_zetarcx_dX);
modelStruct.modelPar_zetare=mod.zetare;
modelStruct.d_modelPar_zetare_dX=0.0;
modelStruct.modelPar_given_zetare=mod.given("zetare");
modParamMap["zetare"] = &(modelStruct.d_modelPar_zetare_dX);
modelStruct.modelPar_zetaiqf=mod.zetaiqf;
modelStruct.d_modelPar_zetaiqf_dX=0.0;
modelStruct.modelPar_given_zetaiqf=mod.given("zetaiqf");
modParamMap["zetaiqf"] = &(modelStruct.d_modelPar_zetaiqf_dX);
modelStruct.modelPar_alkav=mod.alkav;
modelStruct.d_modelPar_alkav_dX=0.0;
modelStruct.modelPar_given_alkav=mod.given("alkav");
modParamMap["alkav"] = &(modelStruct.d_modelPar_alkav_dX);
modelStruct.modelPar_aleav=mod.aleav;
modelStruct.d_modelPar_aleav_dX=0.0;
modelStruct.modelPar_given_aleav=mod.given("aleav");
modParamMap["aleav"] = &(modelStruct.d_modelPar_aleav_dX);
modelStruct.modelPar_zetarth=mod.zetarth;
modelStruct.d_modelPar_zetarth_dX=0.0;
modelStruct.modelPar_given_zetarth=mod.given("zetarth");
modParamMap["zetarth"] = &(modelStruct.d_modelPar_zetarth_dX);
modelStruct.modelPar_zetaver=mod.zetaver;
modelStruct.d_modelPar_zetaver_dX=0.0;
modelStruct.modelPar_given_zetaver=mod.given("zetaver");
modParamMap["zetaver"] = &(modelStruct.d_modelPar_zetaver_dX);
modelStruct.modelPar_zetavgbe=mod.zetavgbe;
modelStruct.d_modelPar_zetavgbe_dX=0.0;
modelStruct.modelPar_given_zetavgbe=mod.given("zetavgbe");
modParamMap["zetavgbe"] = &(modelStruct.d_modelPar_zetavgbe_dX);
modelStruct.modelPar_dvgbe=mod.dvgbe;
modelStruct.d_modelPar_dvgbe_dX=0.0;
modelStruct.modelPar_given_dvgbe=mod.given("dvgbe");
modParamMap["dvgbe"] = &(modelStruct.d_modelPar_dvgbe_dX);
modelStruct.modelPar_aliqfh=mod.aliqfh;
modelStruct.d_modelPar_aliqfh_dX=0.0;
modelStruct.modelPar_given_aliqfh=mod.given("aliqfh");
modParamMap["aliqfh"] = &(modelStruct.d_modelPar_aliqfh_dX);
modelStruct.modelPar_kiqfh=mod.kiqfh;
modelStruct.d_modelPar_kiqfh_dX=0.0;
modelStruct.modelPar_given_kiqfh=mod.given("kiqfh");
modParamMap["kiqfh"] = &(modelStruct.d_modelPar_kiqfh_dX);
modelStruct.modelPar_rth=mod.rth;
modelStruct.d_modelPar_rth_dX=0.0;
modelStruct.modelPar_given_rth=mod.given("rth");
modParamMap["rth"] = &(modelStruct.d_modelPar_rth_dX);
modelStruct.modelPar_cth=mod.cth;
modelStruct.d_modelPar_cth_dX=0.0;
modelStruct.modelPar_given_cth=mod.given("cth");
modParamMap["cth"] = &(modelStruct.d_modelPar_cth_dX);
modelStruct.modelPar_tnom=mod.tnom;
modelStruct.d_modelPar_tnom_dX=0.0;
modelStruct.modelPar_given_tnom=mod.given("tnom");
modParamMap["tnom"] = &(modelStruct.d_modelPar_tnom_dX);


// hidden reals


// non-reals (including hiddens)
modelStruct.modelPar_it_mod=mod.it_mod;
modelStruct.modelPar_given_it_mod=mod.given("it_mod");
modelStruct.modelPar_flnqs=mod.flnqs;
modelStruct.modelPar_given_flnqs=mod.given("flnqs");
modelStruct.modelPar_tef_temp=mod.tef_temp;
modelStruct.modelPar_given_tef_temp=mod.given("tef_temp");
modelStruct.modelPar_flsh=mod.flsh;
modelStruct.modelPar_given_flsh=mod.given("flsh");
modelStruct.modelPar_type=mod.type;
modelStruct.modelPar_given_type=mod.given("type");


// Set the one parameter whose name was passed in to be the independent
// variable for differentiation purposes.  Since we stored variable pointers, this
// makes sure that that ONE variable gets set right.
// FIXME: make this check name for presence first!  Segfault on invalid.
*(modParamMap[name])=1.0;

//make local copies of all model vars
//reals


// non-reals



// Now loop over all instances and do the deed
int inst=0;
for (std::vector<Instance*>::const_iterator in_it=mod.instanceContainer.begin(); in_it != mod.instanceContainer.end(); ++in_it,++inst)
{

  Instance & in=*(*in_it);
  // initialize contributions to zero (automatically sets derivatives to zero)
  for (int i=0; i < 11+0 ; ++i)
  {
  d_staticContributions_dX[i]=0;
  d_dynamicContributions_dX[i]=0;
  }



  // Copy out all the instance parameters (doubles) into local struct
 instanceSensStruct instanceStruct;

 // reals
instanceStruct.instancePar_dt=in.dt;
instanceStruct.d_instancePar_dt_dX=0.0;
instanceStruct.instancePar_given_dt=in.given("dt");


  // real hidden instance


  // Copy all the non-real instance params into vars of their appropriate type:




  // If there are any instance parameters that were not given, and have
  // corresponding model params, copy the model param into the instance.
  // This was already done by the instance constructor, but we do it again
  // because now we're propagating derivatives, and the user could be trying
  // to get sensitivity to the model parameter.


  //make local copies of all instance vars
  //reals
instanceStruct.instanceVar_qjci=in.qjci;
instanceStruct.d_instanceVar_qjci_dX=0.0;
instanceStruct.instanceVar_qjei=in.qjei;
instanceStruct.d_instanceVar_qjei_dX=0.0;
instanceStruct.instanceVar_it=in.it;
instanceStruct.d_instanceVar_it_dX=0.0;
instanceStruct.instanceVar_ijbc=in.ijbc;
instanceStruct.d_instanceVar_ijbc_dX=0.0;
instanceStruct.instanceVar_iavl=in.iavl;
instanceStruct.d_instanceVar_iavl_dX=0.0;
instanceStruct.instanceVar_ijsc=in.ijsc;
instanceStruct.d_instanceVar_ijsc_dX=0.0;
instanceStruct.instanceVar_Ibici=in.Ibici;
instanceStruct.d_instanceVar_Ibici_dX=0.0;
instanceStruct.instanceVar_ijbe=in.ijbe;
instanceStruct.d_instanceVar_ijbe_dX=0.0;


  //non-reals



  Linear::Vector * solVectorPtr = in.extData.nextSolVectorPtr;

  // extract solution variables
probeVars[in.admsProbeID_V_s_GND] = (*solVectorPtr)[in.li_s];
probeVars[in.admsProbeID_V_ei_GND] = (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_ci_GND] = (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_bi_GND] = (*solVectorPtr)[in.li_bi];
probeVars[in.admsProbeID_V_s_c] = (*solVectorPtr)[in.li_s] - (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_c_e] = (*solVectorPtr)[in.li_c] - (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_b_c] = (*solVectorPtr)[in.li_b] - (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_xf_GND] = (*solVectorPtr)[in.li_xf];
probeVars[in.admsProbeID_V_xf2_GND] = (*solVectorPtr)[in.li_xf2];
probeVars[in.admsProbeID_V_xf1_GND] = (*solVectorPtr)[in.li_xf1];
probeVars[in.admsProbeID_V_tnode_GND] = (*solVectorPtr)[in.li_tnode];
probeVars[in.admsProbeID_V_b_e] = (*solVectorPtr)[in.li_b] - (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_b_bi] = (*solVectorPtr)[in.li_b] - (*solVectorPtr)[in.li_bi];
probeVars[in.admsProbeID_V_ci_c] = (*solVectorPtr)[in.li_ci] - (*solVectorPtr)[in.li_c];
probeVars[in.admsProbeID_V_ei_e] = (*solVectorPtr)[in.li_ei] - (*solVectorPtr)[in.li_e];
probeVars[in.admsProbeID_V_s_ci] = (*solVectorPtr)[in.li_s] - (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_ci_ei] = (*solVectorPtr)[in.li_ci] - (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_bi_ei] = (*solVectorPtr)[in.li_bi] - (*solVectorPtr)[in.li_ei];
probeVars[in.admsProbeID_V_bi_ci] = (*solVectorPtr)[in.li_bi] - (*solVectorPtr)[in.li_ci];
probeVars[in.admsProbeID_V_b_ci] = (*solVectorPtr)[in.li_b] - (*solVectorPtr)[in.li_ci];




// Now call  the function that does the heavy lifting.

evaluateModelEquations(
probeVars,
// probe constants
in.admsProbeID_V_s_GND,
in.admsProbeID_V_ei_GND,
in.admsProbeID_V_ci_GND,
in.admsProbeID_V_bi_GND,
in.admsProbeID_V_s_c,
in.admsProbeID_V_c_e,
in.admsProbeID_V_b_c,
in.admsProbeID_V_xf_GND,
in.admsProbeID_V_xf2_GND,
in.admsProbeID_V_xf1_GND,
in.admsProbeID_V_tnode_GND,
in.admsProbeID_V_b_e,
in.admsProbeID_V_b_bi,
in.admsProbeID_V_ci_c,
in.admsProbeID_V_ei_e,
in.admsProbeID_V_s_ci,
in.admsProbeID_V_ci_ei,
in.admsProbeID_V_bi_ei,
in.admsProbeID_V_bi_ci,
in.admsProbeID_V_b_ci,

// node constants
in.admsNodeID_c,
in.admsNodeID_b,
in.admsNodeID_e,
in.admsNodeID_s,
in.admsNodeID_tnode,
in.admsNodeID_ci,
in.admsNodeID_bi,
in.admsNodeID_ei,
in.admsNodeID_xf1,
in.admsNodeID_xf2,
in.admsNodeID_xf,
instanceStruct,
modelStruct,
 in.admsTemperature,
 in.adms_vt_nom,
 in.getDeviceOptions().gmin,
 d_staticContributions_dX,
 d_dynamicContributions_dX,
 in);


  // We now have the F and Q vector stuff, populate the dependencies:

    dfdp[in.admsNodeID_c+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_c];
    dqdp[in.admsNodeID_c+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_c];
    Findices[in.admsNodeID_c+inst*(11+0)] = in.li_c;
    Qindices[in.admsNodeID_c+inst*(11+0)] = in.li_c;
    dfdp[in.admsNodeID_b+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_b];
    dqdp[in.admsNodeID_b+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_b];
    Findices[in.admsNodeID_b+inst*(11+0)] = in.li_b;
    Qindices[in.admsNodeID_b+inst*(11+0)] = in.li_b;
    dfdp[in.admsNodeID_e+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_e];
    dqdp[in.admsNodeID_e+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_e];
    Findices[in.admsNodeID_e+inst*(11+0)] = in.li_e;
    Qindices[in.admsNodeID_e+inst*(11+0)] = in.li_e;
    dfdp[in.admsNodeID_s+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_s];
    dqdp[in.admsNodeID_s+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_s];
    Findices[in.admsNodeID_s+inst*(11+0)] = in.li_s;
    Qindices[in.admsNodeID_s+inst*(11+0)] = in.li_s;
    dfdp[in.admsNodeID_tnode+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_tnode];
    dqdp[in.admsNodeID_tnode+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_tnode];
    Findices[in.admsNodeID_tnode+inst*(11+0)] = in.li_tnode;
    Qindices[in.admsNodeID_tnode+inst*(11+0)] = in.li_tnode;
    dfdp[in.admsNodeID_ci+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_ci];
    dqdp[in.admsNodeID_ci+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_ci];
    Findices[in.admsNodeID_ci+inst*(11+0)] = in.li_ci;
    Qindices[in.admsNodeID_ci+inst*(11+0)] = in.li_ci;
    dfdp[in.admsNodeID_bi+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_bi];
    dqdp[in.admsNodeID_bi+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_bi];
    Findices[in.admsNodeID_bi+inst*(11+0)] = in.li_bi;
    Qindices[in.admsNodeID_bi+inst*(11+0)] = in.li_bi;
    dfdp[in.admsNodeID_ei+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_ei];
    dqdp[in.admsNodeID_ei+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_ei];
    Findices[in.admsNodeID_ei+inst*(11+0)] = in.li_ei;
    Qindices[in.admsNodeID_ei+inst*(11+0)] = in.li_ei;
    dfdp[in.admsNodeID_xf1+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_xf1];
    dqdp[in.admsNodeID_xf1+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_xf1];
    Findices[in.admsNodeID_xf1+inst*(11+0)] = in.li_xf1;
    Qindices[in.admsNodeID_xf1+inst*(11+0)] = in.li_xf1;
    dfdp[in.admsNodeID_xf2+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_xf2];
    dqdp[in.admsNodeID_xf2+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_xf2];
    Findices[in.admsNodeID_xf2+inst*(11+0)] = in.li_xf2;
    Qindices[in.admsNodeID_xf2+inst*(11+0)] = in.li_xf2;
    dfdp[in.admsNodeID_xf+inst*(11+0)] += d_staticContributions_dX[in.admsNodeID_xf];
    dqdp[in.admsNodeID_xf+inst*(11+0)] += d_dynamicContributions_dX[in.admsNodeID_xf];
    Findices[in.admsNodeID_xf+inst*(11+0)] = in.li_xf;
    Qindices[in.admsNodeID_xf+inst*(11+0)] = in.li_xf;
}

}

#endif // Xyce_ADMS_SENSITIVITIES

} // namespace ADMShic0_full
} // namespace Device
} // namespace Xyce
